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

Specific envelope needed!

DSP related issues, mathematics, processing and techniques

Specific envelope needed!

Postby tulamide » Sun Mar 29, 2020 8:53 pm

Hi DSP gurus,

I am in desperate need of something I can't even properly name. Maybe AHR? But that's not completely it:

- It should have an attack (up to 4s, but exponential, so that the really small attack lengths < 0.3s can be edited much more precise than the big ones).
- After the attack phase it should stay at that last level for a specified amount of time (again, up to 4 seconds, again exponential)
- It should then release (again up to 4 seconds, again exponential)

But, it should bypass the usual states. Only Note On is of interest, from there on it just walks through the above mentioned times, so that the voice is either off (preferred) or at least at 0 amplitude, when it passed release, regardless of the key still being held or not (imagine it being detached from the key as soon as it starts, or imagine a one-shot sample, that's what I try to get, but with normal oscillators).

If this could be done in quality code that uses as few cpu time as possible, it would be a huge bonus.

Anybody willing to offer this? Pretty please?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Specific envelope needed!

Postby tektoog » Sun Mar 29, 2020 11:32 pm

Hey,
I'm no DSP guru, but still, I got this… ;)
AHDSR-ASM.fsm
(29.43 KiB) Downloaded 1308 times

I think it is quite optimized :)
Hope it helps...
"Essential random order for chaotic repetitive sequences"
User avatar
tektoog
 
Posts: 141
Joined: Sat Oct 30, 2010 11:49 pm
Location: Geneva - Switzerland

Re: Specific envelope needed!

Postby tulamide » Mon Mar 30, 2020 9:35 am

tektoog wrote:Hey,
I'm no DSP guru, but still, I got this… ;)
AHDSR-ASM.fsm

I think it is quite optimized :)
Hope it helps...

Thank you! Assembler is always good. I'm just not sure if it wastes CPU cycles on calculations that aren't needed (here: decay and sustain)? Wouldn't it be more efficient if it only contains the three elements as described in the first post?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Specific envelope needed!

Postby adamszabo » Mon Mar 30, 2020 10:10 am

tulamide wrote:Thank you! Assembler is always good. I'm just not sure if it wastes CPU cycles on calculations that aren't needed (here: decay and sustain)? Wouldn't it be more efficient if it only contains the three elements as described in the first post?


Yes, you would have to write it from scratch to have maximum optimization. Can you elaborate a bit mroe on what exactly do you need? Does the curve have to be exponential for attack and release or just the control values? What I mean is the attack and release are linear but you can control the time exponentially?
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Specific envelope needed!

Postby tulamide » Mon Mar 30, 2020 7:46 pm

adamszabo wrote:Yes, you would have to write it from scratch to have maximum optimization. Can you elaborate a bit mroe on what exactly do you need? Does the curve have to be exponential for attack and release or just the control values? What I mean is the attack and release are linear but you can control the time exponentially?

Good questions! I'm not concerned about knob control, because I could always program a certain behavior, given the original knob range is linear 0-1. But I'm not sure about the curves themselves, tbh. I need a snappy, "punchy" attack (without clicks) as well as a smooth one, depending on source. If the latter is not doable with exponential curves, then it might be better to go linear. But basically, whatever serves both purposes.

My concern is the cpu load, because I will need this envelope a total of 18 to 24 times, plus possible 3 more (which is not yet clear). Any cpu cycle saved in the design will therefore reduce the load at least sixfold (24 divided by SSE2's 4 parallel channels, right?)

It is also propable that the whole synth is done in blue, if I understood certain properties of blue correctly. The oscillators used are Martin's highly optimized ones and I think I will also go with a filter made by Martin. So that should be already optimized, but this very unusual "one-shot"-envelope is nowhere to be found.

If you need even more information to understand it, please say so!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Specific envelope needed!

Postby BobF » Mon Mar 30, 2020 9:01 pm

Hello tulamide,

I can't help you as I am NOT a coder, but I do have a question that might help others that will help you.
Does the hold stay high for the time duration when a key is released or only while the key is held down?
Hope that makes sense.

Later then, BobF.....
BobF
 
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: Specific envelope needed!

Postby Spogg » Tue Mar 31, 2020 9:24 am

Just for even more clarification…

You stab a note on-off very fast. The whole envelope, which may last for up to 12 seconds, then runs to completion and then the channel closes? And during the Hold section, does it always hold at a value of 1, or hold at the value at which point the note was released during the attack phase?

For a “snappy” attack you really need the attack curve to be linear, which is normal (except in analogue synths like the Mini Moog which are more “logarithmic” due to the charging capacitor).

Also important is whether it will be used in blue or white (poly), since in poly it would need to use the Env prim to open and close channels, but in mono not so.

I can have a go but I think Martin would be best placed to do this efficiently, but the info above would need to be decided in advance.

Cheers

Spogg
User avatar
Spogg
 
Posts: 3318
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Specific envelope needed!

Postby adamszabo » Tue Mar 31, 2020 9:33 am

I could do it, but I would need the info asked by others.
So you need three phases, attack, sustain, release. Do you need all three stages to go through when you hold a note? So you hold a note, and it goes through all three stages but it silent at the end because of the release even though you are still holding the note? Or do you want the attack and sustain, on note press, and the sustain holds until you hold the note and it goes to the release stage when you let go of the note?
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Specific envelope needed!

Postby tulamide » Tue Mar 31, 2020 3:22 pm

Thanks to all of you for the questions!

The three phases are basically just existing to shape an envelope that is then followed everytime, no matter what!

Let's say I have set an attack of 0.2 s, a hold time of 0.5 s and a release time of 2 s.

Whenever a key is pressed, that whole envelope would run through!
- I press and release C4 for a brief moment: The envelope runs over the whole 2.7 s!
- I press F3 for 10 s: The envelope runs only over the 2.7s!
- But if I press and release C4 for a brief moment repeatedly, the envelope restarts on every repeat! (Sound-wise cutting off whatever played and start from 0)

In all cases there shouldn't be any envelope processing anymore after the 2.7s passed, and the sound not active anymore, wether the key on the midi controller is still pressed or not.

That also means that the hold time will always hold at 100%, because attack runs fully through on every occasion (just as the other 2 phases), if not cut off.

Let's say the amplitude is a steady -1.0, then it would take 0.2 s to increase from 0 to -1.0, then hold -1.0 for 0.5 s and decrease to 0 over 2 s. No matter what. Everytime. Unless the same note is pressed repeatedly, while the envelope is running, see above. (As if the system would only react to note on, ignore any note offs and generate their own note off after run through the envelope or at restart)

------------------------------------------------------------------------------

The thing with the blue section is, that a group of oscillators will always only react to exactly one note. There might be playing several notes, but each will trigger a seperate group of oscillators. Imagine pressing A3 and OSC group 1 is triggered, pressing D#4 and only OSC group 2 is triggered, and finally both, A3 and D#4 are pressed simultanously, which triggers OSC group 1 and OSC group 2 simultanously (but only one sound per note is generated from the osc groups)I think, that is best done in blue, right? I don't need polyphony per oscillator. I just need several sounds to play simultanously, one per triggered osc group.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Specific envelope needed!

Postby Spogg » Tue Mar 31, 2020 3:37 pm

I’m becoming progressively more intrigued by the application you have in mind! :lol:

Just to repeat back… You stab a note on-off fast. The envelope sets off on its journey, going up one side, pausing for a breather, and then going back down the hill. But, like Sisyphus, if you stab the note again you immediately restart at the bottom again.
If that’s the case there could be a very sudden change of level from max to minimum level. Would that be acceptable or could it cause nasty clicks?

Cheers

Spogg
User avatar
Spogg
 
Posts: 3318
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Next

Return to DSP

Who is online

Users browsing this forum: No registered users and 34 guests