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
Filter/DSP code/KG questions
5 posts
• Page 1 of 1
Filter/DSP code/KG questions
I summarize my questions here, instead of creating a topic per question.
1. The standard ADSR that we use so often, is pre-set to 4 seconds, if I read the dsp code correctly. But, is the whole envelope 4 seconds (disregarding sustain for this question), or is each stage controllable to up to 4 seconds (attack - 4s, decay 4s, release 4s)?
2. If I want to make the ADSR alternatively tempo-sync'd (to be able to set it to note lengths, like 1/4 or 1/16 etc.), what would be the correct approach? The envelope will be switchable between normal and tempo-sync, and in tempo-sync mode it shall have a fixed maximum, for example a bar note, which would need a flexible time setting, since a bar note at 130 bpm takes less time than a bar note at 70 bpm.
3. KG, I hope you'll read this. Is your assembler module capable of optimizing already existing DSP-Code? If I would use the code from the standard ADSR, would your editor spit out optimized Assembler code or would I need to make changes to the DSP-code first?
4. The ZDF filter calculates all possible outputs at once (LP, HP, BP, etc.). A user won't switch a filter at sample rate, so it will run for a while on just one output. Wouldn't it be better to do the calculations only when needed (if LP is used it doesn't calculate BP, HP, etc.), or are savings too small to justify such approach?
5. With the ZDF filter outputting all filtering at once, I immediatly thought of "morphing" between the filter options (by cross-fading over time). Musically it would create awesome new sounds. I wonder why nobody has done this yet? Doesn't it make sense, or was nobody inspired before?
1. The standard ADSR that we use so often, is pre-set to 4 seconds, if I read the dsp code correctly. But, is the whole envelope 4 seconds (disregarding sustain for this question), or is each stage controllable to up to 4 seconds (attack - 4s, decay 4s, release 4s)?
2. If I want to make the ADSR alternatively tempo-sync'd (to be able to set it to note lengths, like 1/4 or 1/16 etc.), what would be the correct approach? The envelope will be switchable between normal and tempo-sync, and in tempo-sync mode it shall have a fixed maximum, for example a bar note, which would need a flexible time setting, since a bar note at 130 bpm takes less time than a bar note at 70 bpm.
3. KG, I hope you'll read this. Is your assembler module capable of optimizing already existing DSP-Code? If I would use the code from the standard ADSR, would your editor spit out optimized Assembler code or would I need to make changes to the DSP-code first?
4. The ZDF filter calculates all possible outputs at once (LP, HP, BP, etc.). A user won't switch a filter at sample rate, so it will run for a while on just one output. Wouldn't it be better to do the calculations only when needed (if LP is used it doesn't calculate BP, HP, etc.), or are savings too small to justify such approach?
5. With the ZDF filter outputting all filtering at once, I immediatly thought of "morphing" between the filter options (by cross-fading over time). Musically it would create awesome new sounds. I wonder why nobody has done this yet? Doesn't it make sense, or was nobody inspired before?
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Filter/DSP code/KG questions
tulamide wrote:1. The standard ADSR that we use so often, is pre-set to 4 seconds, if I read the dsp code correctly. But, is the whole envelope 4 seconds (disregarding sustain for this question), or is each stage controllable to up to 4 seconds (attack - 4s, decay 4s, release 4s)?
You correctly guessed that the stages are up to 4seconds long. the knob controls the length on 0-4sec range.
tulamide wrote:2. If I want to make the ADSR alternatively tempo-sync'd (to be able to set it to note lengths, like 1/4 or 1/16 etc.), what would be the correct approach? The envelope will be switchable between normal and tempo-sync, and in tempo-sync mode it shall have a fixed maximum, for example a bar note, which would need a flexible time setting, since a bar note at 130 bpm takes less time than a bar note at 70 bpm.
To make the ADSR tempo-synced you need to add BMP prim, divide its output by 60 (to convert it to beats per second) and divide the time scale by that value. Now the knob will be in beats instead of seconds.
tulamide wrote:3. KG, I hope you'll read this. Is your assembler module capable of optimizing already existing DSP-Code? If I would use the code from the standard ADSR, would your editor spit out optimized Assembler code or would I need to make changes to the DSP-code first?
My DSPcode3 module should generate marginally faster ASM code than stock code component. However it will still be far from optimal. I'm not sure if my implementation of "Hop" is faster or slower, so I wouldn't bet money on it
tulamide wrote:4. The ZDF filter calculates all possible outputs at once (LP, HP, BP, etc.). A user won't switch a filter at sample rate, so it will run for a while on just one output. Wouldn't it be better to do the calculations only when needed (if LP is used it doesn't calculate BP, HP, etc.), or are savings too small to justify such approach?
If you look closely at the code, you'll notice that all LP,BP and HP are used to calculate future state. You can't remove them completely.
tulamide wrote:5. With the ZDF filter outputting all filtering at once, I immediatly thought of "morphing" between the filter options (by cross-fading over time). Musically it would create awesome new sounds. I wonder why nobody has done this yet? Doesn't it make sense, or was nobody inspired before?
The ZDF filter is function-wise a state variable filter. They are commonly available in synths and may be controlled by LFOs/envelopes. I'm fairly certain that people played with that before, but that is no reason not to try
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Filter/DSP code/KG questions
KG, thanks for answering all questions! I didn't expect that and thought I'd have to wait for several answers. You cleared up pretty much everything for me. I have just one question left:
How would you deal with the variable time settings on the stages of the ADSR when tempo-sync'd? Currently the value is fixed to a maximum of 4 seconds. At 60 bpm, a bar note would last 4 seconds. At 50 bpm the max time wouldn't be sufficient, and at 150 bpm a bar only takes 1.6 seconds. I'm not sure how to do it. Could you point me to the right direction?
EDIT: In case it wasn't explained good enough, with "morphing" I meant to morph from LP to BP, for example, or from HP to LP, etc. I've never seen that implemented in a synth.
How would you deal with the variable time settings on the stages of the ADSR when tempo-sync'd? Currently the value is fixed to a maximum of 4 seconds. At 60 bpm, a bar note would last 4 seconds. At 50 bpm the max time wouldn't be sufficient, and at 150 bpm a bar only takes 1.6 seconds. I'm not sure how to do it. Could you point me to the right direction?
EDIT: In case it wasn't explained good enough, with "morphing" I meant to morph from LP to BP, for example, or from HP to LP, etc. I've never seen that implemented in a synth.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Filter/DSP code/KG questions
With the setting I've described the ADSR time settings are in "beats" mode ( 4 beats maximum). The envelope will naturally be shorter at higher BPM and longer on lower BPM with the same knob position. That's the point of tempo-sync mode.
Remember - the knob is the same. But the value (which is in 0-4 range) is additionally "multiplied". The fact that at low BPMs the envelope will be longer than 4seconds is no problem at all - the 4second limit is arbitrary - it is set only on the knob. The actual envelope DSP can handle any envelope length.
Yes, I've understood you idea of morphing. I also haven't seen in in synths specifically in a way you've described. But for example FL studio Sytrus synth has built in state-variable-filter. And all of his settings (including HP/LP/BP gain) are automatable and linkable with LFOs and envelopes. So technically speaking it is possible to setup it in a way you've described, though I haven't seen it actually done.
Remember - the knob is the same. But the value (which is in 0-4 range) is additionally "multiplied". The fact that at low BPMs the envelope will be longer than 4seconds is no problem at all - the 4second limit is arbitrary - it is set only on the knob. The actual envelope DSP can handle any envelope length.
Yes, I've understood you idea of morphing. I also haven't seen in in synths specifically in a way you've described. But for example FL studio Sytrus synth has built in state-variable-filter. And all of his settings (including HP/LP/BP gain) are automatable and linkable with LFOs and envelopes. So technically speaking it is possible to setup it in a way you've described, though I haven't seen it actually done.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Filter/DSP code/KG questions
Oh, I didn't see the wood for the trees! Of course it's only a maximum of 4 seconds with the current multiplicator. Changing it changes the time length as well, of course. That was such a stupid question, and I give you great credit for answering it nevertheless.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 34 guests