Friday 5 October 2012

Applying An Envelope - Simple and Numeric Shapes

SimpleShape NumericShape

Making sounds - like the sinwave - is the start of synthesis. However, any real sounding note will also have a volume envelope. Sonic Field uses the same sort of signal for controls like envelopes as it does for audio signals. This means that all the processors which work on audio signals will also work as control signals.

Volume envelopes are easiest to make using the SimpleShape and NumericShape processors:

(
    (0,-99),
    (1000,0),   [attack]
    (2000,-6),  [decay]
    (5000,-8),  [sustain]
    (6000,-99) [release] )SimpleShape !envelope (     (6000,440)SinWave,     ?envelope )Multiply Monitor

Here we make a classic envelope with an attack/decay/sustain/release cycle. The bunches in the input to the SimpleShape processor give time in milliseconds and volume in decibels. So we can read it as saying:

  1. Make and envelope
  2. At 0 milliseconds have -99 decibels which is near silence
  3. Increase till
  4. At 1 second have 0 decibels which is full volume
  5. Decrease till
  6. At 2 seconds have -6 decibels which is half the amplitude
  7. Decrease till
  8. At 5 seconds have -8 decibels
  9. Decrease till
  10. At 6 seconds have -99 decibels which is near silence again


Using SimpleEnvelope defines the shape of the signal is decibels. This is a natural approach because human hearing approximates to perceiving volume on a decibel scale. However, sometimes we want to define envelopes based on a linear scale. This is useful for creating more artificial sounding sustain and also (as we will see elsewhere) for using envelopes for other things than just volume.


(
    (0,0),
    (1000,1),    [attack]
    (2000,0.5),  [decay]
    (5000,0.4),  [sustain]
    (6000,0) [release] )NumericShape !envelope (     (6000,440)SinWave,     ?envelope )Multiply Monitor


This produces an envelop with the same timings as the previous but with linear interpolation between the points rather than logarithmic.

The names SimpleShape and NumericShape come from the history of SFPL. Initially it did not even have NumericShape. 


No comments:

Post a Comment