preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: ricard on March 21, 2018, 09:30:32 PM

Title: [fixed in 2.08b] Problem with envelope retrugger
Post by: ricard on March 21, 2018, 09:30:32 PM
I wanted to experiment a bit with the filter in the preenfm2 so I set up a patch with three detuned sawtooth oscillators, filter set to LP, and env1 patched to the filter frequency, with an attack time of 0 and a fairly short decay and release, and sustain set to 0, to get a fast filter sweep.

There is one filter for all voices in the part, so the result is a paraphonic analog synth patch. The env1 envelope should retrigger for each new key played, and indeed most often it does. But sometimes, especially when the same keys are played repeatedly (but not always), the envelope doesn't retrigger. I can't seem to find a pattern as to when it fails to retrigger. It can happen when the same key is pressed in succession, or when different keys are pressed, when I play slow with lots of time between the key presses, or when I play fast.

Is there something else I should be looking at to get this to work or is this a bug?

I'm running firmware 2.08a (the latest at the time of writing).
Title: Re: Problem with envelope retrugger
Post by: ricard on March 22, 2018, 08:57:26 AM
After a small debugging session (printing out the env1 state in the display) it appears that the envelope is actually getting retriggered, but that the output is being disconnected from the filter for some reason. I've set a fairly low but not zero sustain level on env1, so when what I thought was the envelope failing to retrigger happens, the filter frequency drops down past the sustain level, which it shouldn't.

(When I downloaded the code I was initially surprised to see that it built right out of the box, the reason being because I've already got almost the same version of the compiler installed for my Midibox projects).
Title: Re: Problem with envelope retrugger
Post by: Xavier on March 22, 2018, 11:54:56 AM
Thanks for the report.
I had a look and saw a problem.
I don't have access to my preenfm at the moment. As you can compile the code, can you try the following :

See here in :
https://github.com/Ixox/preenfm2/blob/master/src/synth/Timbre.cpp?ts=4#L296 (https://github.com/Ixox/preenfm2/blob/master/src/synth/Timbre.cpp?ts=4#L296)
We assign a new voice and return.
without setting this->lastPlayedNote  which is done only line 363.

Can you try to add
Code: [Select]
this->lastPlayedNote  = n;line 295 ?
And recompile ?
Thanks,

Xavier
Title: Re: Problem with envelope retrugger
Post by: ricard on March 23, 2018, 07:27:32 PM
Yes, that fixes it perfectly. Thanks Xavier!

/Ricard
Title: Re: Problem with envelope retrugger
Post by: Xavier on March 24, 2018, 09:20:27 AM

Awesome !! thanks for your help on this one.  :)
I'll release a 2.08b firmware when i have some time.