The current jsfx api is (for stream processing) based on three callbacks:
@init
@block
@sample
While this approach offers great opportunities for audio (sample) processing, it is not the perfect approach for midi stream processing, midi modifications on the fly....
Therefore I would like to suggest the following enhancement :
Two more callbacks could be added to the jsfx api :
@tick
Will be called on the smallest midi resolution, which is 1/96 note (1 midi timecode) --> maybe the internal resolution could be used which is higher.
@event
Will be called whenever a midi event is processed (like @sample).This code can analyze, process, or synthesize, by reading, modifying, or writing to the variables evt0, evt1, evt2.. evt63. Evt0 is the current event.Further messages from running status mode will be on the evt1...63.
The evt structure will consist of the items msg1, channel, msg2 and msg3 like in midisend(offset,msg1,msg2,msg3) , a midisend (evt) and a a midisend(offset,evt) would make sense too.
Discussion :
http://forum.cockos.com/showthread.php?t=164407
Version should be 5.5 ....