If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Env prim outputs a 5!
8 posts
• Page 1 of 1
Env prim outputs a 5!
Ok, so here’s something I just found out today that probably every single one of you knew, and didn’t bother to tell me.
I’ve been working on Kevin’s synthi trapezoid generator and had mega probs with the stock linear ADSR module jumping briefly to 1 at the end of release time, with a delayed envelope signal for the release stage (4). Basically my DSP code makes it stay in the sustain stage (3) for a certain adjustable time, then allows the release value (4) to pass.
What I found is that the env prim briefly outputs 5 when the kill bool input goes to true at the end of release, when the envelope is “done”. The voice is killed when the 5 goes back to zero. I think it stays at 5 for about 20mS on my system, so it was tricky to see what was happening. My initial DSP code didn’t provide for a 5 so I got this horrible click as the voice was killed. Once I realised this, it was an easy fix.
The Component Guide doesn’t mention a stage 5, but it’s clear that the old stock ADSR code needed it. Now I can see why there is a >4 in the code!
Cheers
Spogg
I’ve been working on Kevin’s synthi trapezoid generator and had mega probs with the stock linear ADSR module jumping briefly to 1 at the end of release time, with a delayed envelope signal for the release stage (4). Basically my DSP code makes it stay in the sustain stage (3) for a certain adjustable time, then allows the release value (4) to pass.
What I found is that the env prim briefly outputs 5 when the kill bool input goes to true at the end of release, when the envelope is “done”. The voice is killed when the 5 goes back to zero. I think it stays at 5 for about 20mS on my system, so it was tricky to see what was happening. My initial DSP code didn’t provide for a 5 so I got this horrible click as the voice was killed. Once I realised this, it was an easy fix.
The Component Guide doesn’t mention a stage 5, but it’s clear that the old stock ADSR code needed it. Now I can see why there is a >4 in the code!
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Env prim outputs a 5!
That's an interesting find - I've not heard of it before (though I'm more of an effects than synths person, generally.)
I can think of a reason why it might do that, though. Although FS makes it look like DSP is done one sample at a time, in reality, it's still done in soundcard-buffer sized chunks - the VST and ASIO standards require this. The 5 might be a flag to say "kill this voice at the end of the current processing block". If this is correct, and the delay could be measured, I'd predict that the delay varies depending upon how many samples into the current processing block the sustain stage ends.
I can think of a reason why it might do that, though. Although FS makes it look like DSP is done one sample at a time, in reality, it's still done in soundcard-buffer sized chunks - the VST and ASIO standards require this. The 5 might be a flag to say "kill this voice at the end of the current processing block". If this is correct, and the delay could be measured, I'd predict that the delay varies depending upon how many samples into the current processing block the sustain stage ends.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: Env prim outputs a 5!
Hmm, I'll have to remember that point. Thanks Spogg
-
wlangfor@uoguelph.ca - Posts: 912
- Joined: Tue Apr 03, 2018 5:50 pm
- Location: North Bay, Ontario, Canada
Re: Env prim outputs a 5!
Spogg wrote:What I found is that the env prim briefly outputs 5 when the kill bool input goes to true at the end of release, when the envelope is “done”.
Well, at least it doesn't go to 11
Website for the plugins : http://kbrownsynthplugins.weebly.com/
- k brown
- Posts: 1198
- Joined: Tue Aug 16, 2016 7:10 pm
- Location: San Francisco, CA USA
Re: Env prim outputs a 5!
@trog
You seem to be on to something with the buffer clearing thing.
I couldn’t resist timing it, but I got mysterious results:
ASIO buffer 5mS: 35 samples at 5
ASIO buffer 10mS: 31 samples at 5
ASIO buffer 15mS: 623 samples at 5
ASIO buffer 20mS: 421 samples at 5
The number of samples varied a little for each note played and released, but were all close to the above values.
This was how I measured. The link on the left goes to the env output on the Env prim. Each time I measured I cleared the mono readout first by clicking on its blue input.
WTF?
Cheers
Spogg
You seem to be on to something with the buffer clearing thing.
I couldn’t resist timing it, but I got mysterious results:
ASIO buffer 5mS: 35 samples at 5
ASIO buffer 10mS: 31 samples at 5
ASIO buffer 15mS: 623 samples at 5
ASIO buffer 20mS: 421 samples at 5
The number of samples varied a little for each note played and released, but were all close to the above values.
This was how I measured. The link on the left goes to the env output on the Env prim. Each time I measured I cleared the mono readout first by clicking on its blue input.
WTF?
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Env prim outputs a 5!
Guys, I got some more insight into the mysterious appearance of stage 5.
My current project has several envelope generators and these will often be set to different total times.
In these circumstances those who complete early will then show a 5 on the Env prim’s stage output pin. They only fall back to zero after the longest envelope is complete and the poly voice channel will only then be closed.
So you could say that a 5 is saying
“I am wounded and ready to die, but will not finally succumb to non-existence until the last of my comrades has completed our glorious destiny. May we all be re-born when the Great Player so decides.”
Cheers
Spogg
My current project has several envelope generators and these will often be set to different total times.
In these circumstances those who complete early will then show a 5 on the Env prim’s stage output pin. They only fall back to zero after the longest envelope is complete and the poly voice channel will only then be closed.
So you could say that a 5 is saying
“I am wounded and ready to die, but will not finally succumb to non-existence until the last of my comrades has completed our glorious destiny. May we all be re-born when the Great Player so decides.”
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Env prim outputs a 5!
Thanks, interesting find!
- adamszabo
- Posts: 667
- Joined: Sun Jul 11, 2010 7:21 am
Re: Env prim outputs a 5!
Excellent detective work, Spogg; and well explained! That's definitely a good one to know.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 35 guests