<CsoundSynthesizer><CsOptions>-odac -Mhw:1,0,0
</CsOptions><CsInstruments>cnt@global:i=cntcreate(1); a togglecntNote@global:i=cntcreate(1); ignore note-off message to turn MIDI notes into togglesinstr1key:k=sensekey()note:i=notnum()ifkey==97thenk1=count(cnt)ifk1==0thenevent("i",2,0,-1)elseevent("d",2,0,-1)endifendifprint(note)ifnote==60theni2=count_i(cntNote)print(i2)ifi2==0theneventi("i",3,0,-1)elseeventi("d",3,0,-1)endifendifendininstr2out(poscil(10000,440))endininstr3out(poscil(5000,880))endin</CsInstruments><CsScore>i10ze</CsScore></CsoundSynthesizer>
<CsoundSynthesizer><CsOptions>-odac -Mhw:1,0,0
</CsOptions><CsInstruments>gicntcntCreate1; a togglegicntNotecntCreate1; ignore note-off message to turn MIDI notes into togglesinstr1kkeysensekeyinotenotnumif(kkey==97)thenk1countgicntifk1==0thenevent"i",2,0,-1elseevent"d",2,0,-1endifendifprintinoteif(inote==60)theni2count_igicntNoteprinti2ifi2==0thenevent_i"i",3,0,-1elseevent_i"d",3,0,-1endifendifendininstr2asigoscil10000,440outasigendininstr3asigoscil5000,880outasigendin</CsInstruments><CsScore>i10ze</CsScore></CsoundSynthesizer>