Source code: | sinus.cpp |
sinus is an example of how to map MIDI note-on message parameters into parameters for other note-generation algorithms.
For this program, the input key number specifies the pitch center of the sinewave note generator. The attack velocity of the incoming note determines the amplitude of the sinewave note generator. From the computer keyboard you can control the period of the sinewave as well as the tempo (?).
Here is a schematic of the sinewave note generator:
And here is a demonstration of how the pitch set is calculated for a period of 3 and a period of 4:
An interesting alteration to this program would be to make the period of the note generation algorithm become non-periodic.