gen~ on Daisy Field — gate trigger to reset envelope (kick drum)
Hi everyone, I'm building a kick drum synthesizer in gen~ for the Daisy Field using oopsy. The synth works fine in looping mode triggered internally by a phasor, but I cannot get an external gate input to correctly reset and retrigger the amplitude envelope.
The amp envelope is a classic exponential decay using history feedback: aeh (history) → multiply by amp_dec → add tlc (trigger impulse from phasor < 0.001) → back to aeh.
When gate1 goes high I want the amp envelope to immediately reset to 1 and decay from there. Same for the pitch envelope.
What I tried: param gate1 → change → > 0 to get a single-sample trigger on the rising edge, then "? 1" to reset aeh to 1 on trigger (aea into inlet 0, gpos into inlet 1), and selector to reset pitch env to pitch_amt on trigger. None of these work correctly — the envelope either stays open continuously or never triggers.
The core question: what is the correct way in gen~ to reset a history-based feedback envelope to a specific value on a single-sample trigger? Specifically in the context of oopsy on Daisy where gate inputs are sampled at block rate (48 samples).
Is accum + pow the right approach? Or is there a cleaner idiom for this in gen~?
Thanks
For a simple exponential decay, you just need to multiply by some number a little less than 1.0 in a feedback loop, and yes, using a switch (like ? 1) to retrigger -- the basic idea sounds right.
Here's a quick example using t60 to calculate the desired decay multiplier:
To get more control over the shape, you might want a different structure: using a linear ramp (e.g. 0..1), which you can then shape with some kind of unit shaping curves, for whatever behaviour you want -- whether from math, or lookup tables, etc. Here's a basic structure for the linear ramp:
BTW you don't have to use a block size of 48 or samplerate of 48khz on the Daisy/with Oopsy, you can also use 96khz and much smaller block sizes if you want. The CPU cost will go up, but could be worth trying to see if you can afford it!
Hi Graham,
thank you very much for the explanation and for taking the time to reply I really appreciate it.
I'm currently experimenting a lot with gen~ on the Daisy and your suggestion helps clarify the direction I should take with the envelope structure.
Also, I just wanted to say that I'm really enjoying your fantastic book, it has been a great source of inspiration while exploring these systems.
Thanks again!
Emiliano