Support

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!

For general discussion related FlowStone

Env prim outputs a 5!

Postby Spogg » Mon Jun 17, 2019 5:16 pm

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. :lol:

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
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Env prim outputs a 5!

Postby trogluddite » Mon Jun 17, 2019 5:47 pm

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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Env prim outputs a 5!

Postby wlangfor@uoguelph.ca » Tue Jun 18, 2019 1:03 am

Hmm, I'll have to remember that point. Thanks Spogg
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: Env prim outputs a 5!

Postby k brown » Tue Jun 18, 2019 4:14 am

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 :o :lol:
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!

Postby Spogg » Tue Jun 18, 2019 8:37 am

@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.

samples spent with env at 5.png
samples spent with env at 5.png (96.29 KiB) Viewed 16323 times


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
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Env prim outputs a 5!

Postby Spogg » Sun Jul 07, 2019 10:01 am

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
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Env prim outputs a 5!

Postby adamszabo » Sun Jul 07, 2019 11:34 am

Thanks, interesting find!
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Env prim outputs a 5!

Postby trogluddite » Sun Jul 07, 2019 6:33 pm

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!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to General

Who is online

Users browsing this forum: No registered users and 19 guests