Would it be possible to make the envelopes respond to modifications of A,D,S and R immediately (so not only after a new note is triggered)?
What purpose are you aiming to? Just curious…
For example if the release is set to max, you play a note, realize the release is too long and you reduce it. Still the one note you have already played has a very long release and keeps on sounding.
Or you want to adjust the sustain level. The it is very handy if you can play a note, wait until it is in the sustain stage, and then adjust the sustain level live. Otherwise its more trial and error.
I think most other synths show that behaviour and I think its more intuitive and playable.
What you describe is the behaviour of most analog synths. They have to behave like this because the pots directly control the settings on circuit level. With most digital (controlled) synths it’s the way as is with the Ambika. I guess it’s more difficult to implement this in them.
It depends on the implementation, some time ago I wrote some (Synthmaker) code which does it the ‘analog’ way. The question is if it would work on the Ambika. I took a quick look at the code and tried to understand it:
In envelope.h, there is the function trigger. This sets b_. b_ is the used in Render() to determine the value of the envelope. So to work in the ‘analog’ way, b_ would have to be updated in Render(), and not in Trigger(), I guess.
I really have to get my avr toolchain running, so that I can try out all these little mods.
Calling the code refreshing the envelope increments at every sample is more computationally expensive and might exceed the available CPU resources. I suggest you to test it very, very carefully!
What about adding “b_ = stage_target_[stage_];” at the end of Update()?