Subsections
Figure 2 summary
- trigger envelope
- set attack and decay
- MIDI to Hz
- line object
- amplitude envelope
We need some sounds. If we take a [osc~] oscillator and multiply it
by a falling line that will give us a basic decaying tone. The [osc~] oscillator has
frequency as its first control inlet and one audio signal output. We want an
amplitude envelope control signal that starts off at maximum and decays away to zero. The
[line~] generator takes message arguments of the form (level to go
to, time to get there), so a message [1 0( will send the line
to a value of 1 in 0 milliseconds. Sending a further message like
[0 700( will set it moving back to zero
over 700 ms. [1 0, 0 700( is a pair of messages
in a single message box. The comma causes both messages to be sent in left to
right order instantly, so this will send the
line to one in 0 milliseconds, and then back to zero in 700ms. A line envelope is a powerful component of more
complex controls, we will also meet its more versatile brother
[vline~] shortly. The result of multiplying the sinewave signal by the line is a pure
tone that decays away.
In order to control this synth with MIDI notes instead of Hz frequency let's
add a [mtof] object. Notes appearing at the [inlet] will now be converted to Hz
before being sent to the oscillators frequency inlet.
B-synth1.pd
Andy Farnell
http://obiwannabe.co.uk/