Here I will describe the routines that are involved in actually generating the MIDI noteon/noteoff events associated with the various phrases. More to come.