On 6/29/20, Till Bovermann <lf...@lfsaw.de> wrote: > Dear list, > > I wonder if anyone has a clue how to implement demand-rate in faust.
Hi Till, Have you looked at latch and/or sAndH in basics.lib? They may be the closest thing to what you're looking for. Either using those functions directly or looking at their definition may help you. The key trick is to use a feedback loop (~) and a conditional (select2) to create behaviour along these lines: if trigger then output a value from a generator function; else output whatever value I output last time. But faust has a quirk in how it treats the unused branch of a conditional statement, if the branch has some kind of internal state: it evaluates them anyway in order to update the state. In other words, a counter (1, 2, 3...) latched to a trigger running every second sample (1, 0, 1, 0...) will output not 1, 1, 2, 2, 3, 3... but rather 1, 1, 3, 3, 5, 5... This may not be what you want in this case. Unfortunately, I don't believe there's a way to escape it. For what it's worth, I find this very frustrating and wish there were a way to defeat it. _______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users