You're off to a good start, and breaking things down like this is a good idea, but it involves the use of some extra opcodes to get it to work. One way you can do it is to trigger the other instrument from play from the main instrument. You can do this using
subinstr. It's not used that often any more since UDO can into being, but it'll do the trick. What I did was this:
chnset aOutL, "Audio1L"
chnset aOutR, "Audio1R"
;start instr2 and play for as long as this instrument is playing
aL, aR subinstr "ADSR_Instr"
outs aL, aR
When the first instrument plays, via the keyboard, it plays the second instrument and grabs the output from it.It then feeds that output to the speakers. When you call an instrument with subinstr, it won't output to the speakers. The output has to be retrieved from the calling instrument. I've attached the updated file. Note that you could probably use channels and send it to another instrument that is always on, but perhaps this way is a little clear. And you can name your instruments to make thing even clearer.
Let me know if this all makes sense JMSynth_01.csd (4.5 KB)