I have 8 triggers of which all fire depending on certain logical conditions. All of the conditions do not have any overlap so they cannot fire at the same time, but they can fire very shortly after eachother. We are talking about in-between-periods smaller than 100 samples. What i am trying to achieve is that if one of the triggers fires, all triggers (including the one that just fired) will not be registered for a set amount of time. I know this this possible with TDelay which filters out any incoming triggers between the input and the delayed output. But the problem is that i cant have a delay bigger than 0.01 seconds, but i do need a relax time of bigger than 0.01 seconds.
trig1 = Trig1.ar(crossBeginCond & chanCond1, 0.01);
trig2 = Trig1.ar(crossBeginCond & chanCond2, 0.01);
trig3 = Trig1.ar(curHeadCond & chanCond1, 0.01);
trig4 = Trig1.ar(curHeadCond & chanCond2, 0.01);
trig5 = Trig1.ar(exception1 & chanCond1, 0.01);
trig6 = Trig1.ar(exception1 & chanCond2, 0.01);
trig7 = Trig1.ar(exception2 & chanCond1, 0.01);
trig8 = Trig1.ar(exception2 & chanCond2, 0.01);
// if im not mistaken this realizes a trigger cooldown time of 0.01
// i want a bigger relax time but a delay of at most 0.01
// t_outx only fires when trigx was the first of all triggers to fire
// this works because none of the trigx's can fire at the same time
// i hope this is correct
t_out1 = TDelay.ar(trig1, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out2 = TDelay.ar(trig2, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out3 = TDelay.ar(trig3, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out4 = TDelay.ar(trig4, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out5 = TDelay.ar(trig5, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out6 = TDelay.ar(trig6, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out7 = TDelay.ar(trig7, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
t_out8 = TDelay.ar(trig8, 0.01) * TDelay.ar(trig1 + trig2 + trig3 + trig4 + trig5 + trig6 + trig7 + trig8, 0.01);
LocalOut.ar([t_out1, t_out2, t_out3, t_out4, t_out5, t_out6, t_out7, t_out8]);
I can delay everything in the synthdef by the wanted relaxtime, and then set TDelay to 0.01 + relaxtime. This way the trigger delay time relative to the rest of the synthdef is not bigger than 0.01. But i’d like to avoid this, since this complicates things and reduces responsiveness.
Is there anything i can do?