DigitalWhiteByte ·
Is not yet possible to control the release of a polyphonic note while is played?Old Topic
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
DigitalWhiteByte ·
Is not yet possible to control the release of a polyphonic note while is played?Old Topic
oddson ·
As it says, it was possible even then... if you use a coded envelope.
My first try at a coded Env was from Nov. 2006 and to make it work as required I just got rid of the stage(0) markers Custom Envelope Example File
DigitalWhiteByte ·
thanks for the link, in fact wondering if someone could give me a tip on how to handle it :P
DigitalWhiteByte ·
I downloaded the ADSR Envelope Retrig from WIKI, I moved and what is the Stage (0) in the global cycle "hop",just for testing. seems to work visually at least not yet tested thoroughly with audio signals, and we'll work on will let you know.
oddson ·
DigitalWhiteByte wrote: thanks for the link, in fact wondering if someone could give me a tip on how to handle it :P
That was my hint...
If you need any help just ask with specifics. Really the only thing is you can't freeze the release slope calculation inside stage(0).
Sustain level was already outside stage(0) but the slope of the decay is based on S level so you can get wierd results from changing S while you're still in the D stage (I never noticed this before).
(All of this is based on my original code -- I'm really not sure what's in the infusion posted version in the WIKI.)
DigitalWhiteByte ·
I'll try to explain. I would like to be able to handle the parameters of the envelope in real time even if the note is running, for example by executing a note with the envelope set with a long release, after releasing the key, it can be shortened, the same for the other parameters. I know that's not really a simple thing, in fact I own the difficulties in testing phase between dacay and sustain, as you said. The release and the attack seems to work fine, but I have a strange behavior of the decay according to sustain, it always emits a little strange sound.
infuzion ·
DigitalWhiteByte wrote: The release and the attack seems to work fine, but I have a strange behavior of the decay according to sustain, it always emits a little strange sound.
Might be the new sound levels re-calculating? But we can't read your mind hearing the sounds; need an OSM to test plz.
DigitalWhiteByte ·
I did not do much, I just moved a section of code
MichaelBenjamin ·
i think the reason for this behaviour and stage 0 is that on a midi retrigger stage 0 doesnt get executed again if there is already a voice running (in release) on that specific sse channel. stage 0 only executes when the voice on that channel has been terminated before. so for all midi triggered white streams, stage 0 is not that useful, since you cant effectively control when it gets executed (unless you have some very high poly set to make sure that each new voice gets its own fresh channel).
DigitalWhiteByte ·
The weird sound is caused by the hop that decimates the quality of the curve. I am now trying the code without hop and some changes and it seems to begin to work, but is a monster eats cpu. When I have a version that works more or less, will post it.
oddson ·
DigitalWhiteByte wrote: The weird sound is caused by the hop that decimates the quality of the curve. I am now trying the code without hop and some changes and it seems to begin to work, but is a monster eats cpu. When I have a version that works more or less, will post it.
That 's funny... I recall typing something about losing the hop() in my post from yesterday but I guess I lost that edit somehow... I'm not sure that's what you're actually expericing though.
Here are some issues off the top of my head...
1) If you drop the sustain portion lower while the stream is still in decay there will be a discontinuity at the boundary unless you force the decay to go longer or fall more steeply (the latter is tough because it could be a moving target and what do you do if it moves with 5 MS left in the decay time?).
2) For there to be a fixed release time the release slope can't be calculated until the sustain has ended if you can alter the sustain while it's playing. But in the absence of real conditionals you'll end up calculating it over and over until you do need it. So here too it might be best to calc the slope and then apply it to whatever value the sustain is at… allowing that the time of the release will be different than the input setting.
3) What do you do with attack if it's lowered during the attack phase?
So the solution is likely to use slopes instead of times… still could be tricky given you can't use normal conditionals and are forced to do everything with masks.
oddson ·
...oh. and you could keep a hop() and even make it bigger and then just add a low-pass filter to even out the ENV signal.
trogluddite ·
oddson wrote: So the solution is likely to use slopes instead of times
Indeed - this is exactly how it works in an analogue synth - the envelope is 'calculated' from the charge in a capacitor charged and discharged through the attack, decay and release controls (resistors) - so the controls would be setting rates, not times. They wouldn'd even have been linear rates, as capacitors charge/discharge exponentially - which just so happens to sound nicer to many people too, as the exponential curves are perceived as 'snappier'. I don't recall Moog players having a problem with this - using true envelope times is only really important if tempo sync is required (usually only needed when using multi-stage envelopes for rhythmic modulation effects).
Gives me an idea - could this exponential behaviour not be simulated thus... At a change in stage, a new 'target' value for the envelope is set (one for attack, sustain level for decay, zero for release), and the 'time' used as the coefficient of a very slow low-pass filter (same thing as the 'hop smoothing' filter). That ought to recreate the same behaviour as an analogue Resistor/Capacitor envelope circuit, I believe - though I'm unsure how ending a poly voice might be done.
DigitalWhiteByte ·
is just an 'ideas, I think we should create a parser to the module ENV, reassigning the various stages to perform their proper functioning. Perhaps this might help, by assigning a counter for each stage, so it could still be hopped up and operate in real time?
DigitalWhiteByte ·
this is more or less what I meant, I think I figured out how to eliminate the clicks when you reset the voices to the envelope, in this I have made a trick. It can certainly be optimized yet, so it will test.
Wrote something here? To have a post removed or your name hidden, write to [email protected].