Hey hey,
I have a MIDI activated instrument, by using realtime MIDI events (-+rtmidi=...). Inside that instrument I need to call other instruments. Or possibly activate one instrument several times by one MIDI event. Her's the basic outline:
massign 1, "Player" ; Assign MIDI channel 1 to Player
instr Oscillator
; Play some sound using p4 and p5 MIDI note and velocity
endin
instr Player
; start several Oscillator instruments
; and stop them, when the MIDI note ends
endin
Of course, the Oscillator instrument is something quite complex that would require a lot of code to duplicate and thus be open to typos, huge code redundancy and very awkward maintenance. Any kind of loop, like while or loop_lt would not work either. Think of it like a string section made up of individual instruments.
Is there any tried and tested solution? Or perhaps a good opcode which I have overlooked that is made for this purpose?
Best wishes and thanks,
Jeanette