Sheesh, that’s my fault! Doing an example for the Github Issue Forum I notice that I included p3 as a parm of the transegr opcode, which is not right while using a midi-trigger note to run the instrument. So if I do this:
massign 0, "MidiDev"
alwayson "MidiDev"
instr MidiDev
itrig notnum
icheck active "Osc"
if(itrig==43&&icheck==0)then
schedule "Osc", 0, -1
elseif(itrig==43&&icheck>0)then
turnoff2 "Osc", 0, 1
endif
endin
instr Osc
iamp = .5
iatt = .003
idec = .25
irel = 3
;aEnv expsegr .001, iatt, iamp, idec, iamp*.75, irel, .001
;aEnv linsegr 0, iatt, iamp, idec, iamp*.75, irel, 0
aEnv madsr iatt, idec, .75, irel
;aEnv transegr 0, iatt, 5, iamp, idec, -2, iamp*.75, irel, 0, 0
iTri ftgenonce 0, 0, 4096, 7, 0, 1024, 1, 2048, -1, 1024, 0
aOsc poscil aEnv, 220, iTri
outs aOsc, aOsc
endin
all my multi-staged envelopes work!
What a noob
Cheers to all,
Matteo