Figure 2 summary
Here we have an
- number box
- message melody
- note number to Hz
[osc~] object with its frequency inlet connected to a number
that comes via a
[mtof] unit. This converts "midi" to "frequency", where
a midi note is an integer in the range 0 to 127, and frequency is a value
in Hertz between zero and about twelve thousand.
The number boxes in pd-gui can be used either as display devices or as
input devices. Here is shown the type 2 box which can be coloured and
has other useful properties. Moving the number by clicking and pushing your mouse
up and down sends new values to
[mtof]. If you want finer grain
control than just integers try holding down the shift key before you click.
Some message boxes can be immediately used to compose a melody. This isn't
the perfect way to write music, but you can simply add message boxes and
Listen to the output frequency change as you move the number over the whole
MIDI scale from 0 to 127. Connect another number box to the output of
and notice the relationship between key number and pitch is not a simple
linear one. Each 12 notes doubles the frequency.