HomSpace Forum

Full Version: ADSR
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

soumello

[font=-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"]Hi again Hansehv! I installed your samplerbox and i loved it! Really amazing! I was just wondering if there is a easy way to control attack release decay and sustain with it. I saw in the code that you added a linear function to do it however im trying here to add a exponencial function like normally is. Im still a beginner at coding for music stuff so im trying to figure it out how to do it, do you have any ideias since you now this code better than me? I was thinking about maybe trying with csound but i would have to change the sound engine or try to change the pyx code to use some exponential function for this adsr envelopes. Thanks for your attention![/font]
Hi Soumello,

Interesting question.
Attack, Decay and Sustain envelope characteristics are taken from the sample(s), so I assume you talk about the Release.

As far as I can see in samplerbox_audio.pyx, the time=length of the release is calculated linear, but the fadeout volume it self isn't.
I can't really explain what the line pairs 176-177 and 195-196 do with the volume, but it certainly doesn't look linear.
And it all sounds pretty natural.
But perhaps I missed your point.

Regards, Noek.

soumello

(28-05-25, 21:25)noek Wrote: [ -> ]hi noek!

So, yes, release is the most important ADSR parameter for sure because, as you said, the other parameters are "inside" the note on note off. But lets say that you have a saw pad with fast attack. Sometimes a like to use a Saw with slow attack and sometimes i like with fast attack. So instead of using 2 presets(one with slow and other with high attack) i was thinking about using just one (with fast attack) and add an attack knob that could make this volume automation for me. The same thing for a decay. Lets say i want the sound decaying 2sec while i play or the sustain: lets say i want 2sec of a sustained note and then it decays for 3sec. The thing is: yes, we could achieve it in the sampling process but it would be super cool do have this type of envelope control usig knobs real time. I was thing about using a .cpp enevelope generator that someone already made an trying to integrate. Thanks again for your answer!