In the follow change I use an accumulator for the triggers (ktr). If the value of the accumulator is positive after ~ 15 msec (quantized with kr), the trigger for midion2 (ktr_filtered) is 1 otherwise it is 0. It avoids multiple triggers within 15 msec (you can change this limit). The `reinit/rireturn' code is useless in this case and it is to remove. ... itr_delay = 0.015 icycles_limit = itr_delay * kr kcycles init 0 ktr_accum init 0 ktr_filtered init 0 if (kcycles > icycles_limit) then ktr_filtered = (ktr_accum > 0 ? 1 : 0) ktr_accum = 0 kcycles = 0 else ktr_accum = ktr_accum + ktr kcycles = kcycles + 1 endif /* MIDI Out */ kchn = 1 ;; knum is -35 when kpch is zero if knum > 0 then midion2 kchn, knum, kvel1, ktr_filtered ktr_filtered = 0 endif ... tito