oddson ·
I know I've seen this before but can't remember how to achieve it.
The idea is to have a boolean mask that acts as a trigger to sample the current input value when it transitions to true and hold it as output until the next triggering.
I thought it looked something like this:
streamin in; streamboolin sample; streamout hold; float notSampleOld;
hold = (sample & notSampleOld) ... in; //missing something at this point???
notSampleOld = (sample & 1) == 0; true when false (not).