Friday, 19 March 2010

4 - FM Synth with QWERTY control

The FM patch can now be controlled via a QWERTY keyboard for experimentation purposes. The patch also allows control of the harmonicity relationship between the carrier and modulating frequency.

A subpatch was created to contain the QWERTY elements. A 'key' object accepts key inputs from a QWERTY keyboard. The number box connected directly is used to identify the ASCI code of a key that has been pressed. It is then passed through to a series of 'select' objects, which will send a 'bang' message whenever it receives the ASCI key identified in its argument. The bang messages are sent to a particular number box (which has been set to display MIDI notes) so that each key press is assigned to its own musical note. The notes are then received by the 'mtof' object which automaticly converts MIDI notes to the correct frequencies, which will be received by the oscillators.
The bang message from the select objects is also sent to a message argument (0.8), which when received will set the volume to 0.8 (or 80%).
The 'keyup' object sends a bang message whenever a key is lifted and is sent to a message argument (0) also connected to the volume control which resets it back to 0.

The turquoise '1' and '2' outlets correspond to the two outputs of the subpatch in the main patcher window.
The harmonicity ratio is set via a number box, it is connected though a 'sig~' object, which converts its input into a signal. Basically this is done so that it sends a constant signal rather than just a message whenever the number is changed.

No comments:

Post a Comment