Out = (GreenBool != 0); //Non-zero to true bitmask.
streamin Trigger; //Green bool will work here
streamin Factor; //Decay control (0 ... 1) = (short ... long)
float OldTrigger=0; float Small=1e-020;
Envelope = Envelope * Factor; //Decay
Envelope = Envelope & (Envelope>Small); //Kill de-normals
// Set to one on leading edge of trigger pulse
Envelope = Envelope + (1-Envelope) & (Trigger>OldTrigger);
OldTrigger = Trigger;
1) The envelope will need the "Trigger" property ticking to work with mono/mono4 signals - by default it is only in "automatic mode" for triggering only by messages from the poly voice manager.
tester wrote:'m still lost? "Trigger property ticking" ? Where and what to change?
tester wrote:I tried second example, but I'm afraid that I don't follow it yet. "Factor" values below 1 are soundless, and =1 just produce continuous (or just verly slow fading) sound.
p.s.: Generally I would need something, that allows to retrig the fade from 1 down - during ongoing fading too
tester wrote:Ah - my english failed.
trogluddite wrote:Thankyou Martin, I had a feeling it wasn't anything too complicated.
I also found the scaler from the old schematic that I used - very similar power function, but I think this one was scaled for a different end value. My end value of 1e-20 in the code is just an arbitrary very small number to eliminate de-normals - it is way below the threshold of hearing, so the "audible" part of the envelope may seem a bit short when calculating to that end point. The equation used in my schematic is...
e ^ ( (-1000 / SampleRate ) / MilliSeconds)
...where e is Euler's number (about 2.71828).
cyto wrote:He he. I know there are a lot of "Martins" on this board, but I am not one of them
tester wrote:unusual instrument
tester wrote:Okay, just tested, and this is it. But now things get a little bit more complicated. Cyto - could you add something to the code that would allow to set very short and smooth transition on retrig? Sizes in miliseconds (<5 ms I guess). The thing is - when envelope is retriggered, then transition tends to produce noticable "digital click". I'd like to make it more like analog soft hit, and I guess this is the direction (correct me if I'm wrong).
tester wrote:p.s.: when duplicated many times in the schematic (like 4x12) - SM becomes unstable and crashes often (I'm thinking to reach a target with c.a. 10x30 different envelopes) - to which part of the code could it be related? Is it possible to make some performance improvement by producing envelopes based on one main theme? (i.e. ratio based time lenght, so results of main code would be just scaled somehow?)
Users browsing this forum: Google [Bot] and 2 guests