Old 01-24-2014, 11:02 PM   #1
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default MIDI-triggered DADSR

A reupload with some reworking. One file has now become two - the plugin itself and the import library that it uses.

Does what it says on the package - on NoteOn it triggers the envelope (Delay, Attack, Decay, Sustain) and on NoteOff it fires off the Release. Pretty straightforward stuff.


Stash link

https://stash.reaper.fm/v/19590/midi-dadsr.zip


Using the library in your own plugins is easy (hopefully). The import code goes before @init, then call the dadsr_init() function...

Code:
import st.dadsr.jsfx-inc

@init
volume.dadsr_init(delay,attack,decay,sustain,release);
Delay, Attack, Decay, and Release are all in milliseconds (ms). Sustain is a decibel value. For example,

Code:
volume.dadsr_init(20,50,200,-9,1000);
Has a 20 ms delay, takes 50 ms to reach its maximum value (either 1 or "scale" if you've set it), 200 ms to decay down to its sustain volume of -9 dB, then one second to decay away.


To update the envelope values, you can do it all at once, like this -

Code:
@slider
volume.dadsr_update(newDelay,newAttack,newDecay,newSustain,newRelease);
or singly, like this -

Code:
@slider
volume.dadsr_setdelay(newDelay);
volume.dadsr_setrelease(newRelease);
volume.dadsr_setdecay(newDecay);
etc
In the @sample block, run the process() function each time. You can then use the env variable to do your volume modification needs, like such :

Code:
@sample
volume.dadsr_process();

spl0 *= volume.env;
spl1 *= volume.env;
There are two ways to turn it on, and one way to turn it off.

Code:
volume.dadsr_trigger();
volume.dadsr_attack();
volume.dadsr_release();
The first starts the envelope from the beginning (including delay), the second ignores the delay and starts from the attack, the third tells it to start the release.

You can set the maximum value (the "scale") by doing this

Code:
volume.dadsr_scale(value);
Which is really useful if you want to do something like attach it to the velocity of a MIDI note, yes?

Okay. Yeah. Questions?
SaulT is offline   Reply With Quote
Old 05-11-2014, 11:34 PM   #2
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Hi SaulT and thanks for your time creating this js plugin! So can I use this js to add an envelope filter to reasamplomatic?
_TIP_ is offline   Reply With Quote
Old 05-12-2014, 04:05 AM   #3
reapercurious
Human being with feelings
 
reapercurious's Avatar
 
Join Date: Jul 2007
Posts: 1,890
Default

is this an amplitude envelope or a "control voltage" envelope?
reapercurious is offline   Reply With Quote
Old 05-12-2014, 12:24 PM   #4
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Yes, you can add this as a volume envelope for another plugin, like reasamplomatic; that was the intention from the get-go.

This is not a CV plugin, it is ADSR with an added "delay" in front. It only responds to trigger events, in this case noteOn and noteOff.

timeline -

on note-on
wait "delay" number of ms before turning on the envelope
take "attack" number of ms to turn envelope on
take "decay" number of ms to drop to sustain volume
stay at "sustain" dB until note-off
on note-off
take "release" number of ms to turn envelope off

Does that help?

You can also check out the Wikipedia entry on it.

"Certain synthesizers also allow for a delay parameter before the attack. Modern synthesizers like the Dave Smith Instruments Prophet '08 have DADSR (delay, attack, decay, sustain, release) envelopes. The delay setting determines the length of silence between hitting a note and the attack."

http://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope
SaulT is offline   Reply With Quote
Old 05-12-2014, 11:08 PM   #5
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Thanks for your reply SaulT. So to make it clear: Is it possible to add a filter fx after the SamplOmatic5000 and then just control the freq parameter of the filter with your ADSR fx?
_TIP_ is offline   Reply With Quote
Old 05-13-2014, 04:48 PM   #6
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Quote:
Thanks for your reply SaulT. So to make it clear: Is it possible to add a filter fx after the SamplOmatic5000 and then just control the freq parameter of the filter with your ADSR fx?
Oh, I see what you're saying - for some reason I thought that we were talking about the other way round. Yes, it is possible, albeit with a bit of coding. The bundled plugin is meant as a volume envelope, but the included library could be used to that effect.

I suppose the goal would be to convert a noteOn to an ADSR envelope which modulates a MIDI CC, then tie that filter cut-off to the CC?
SaulT is offline   Reply With Quote
Old 05-13-2014, 10:43 PM   #7
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Quote:
Originally Posted by SaulT View Post
I suppose the goal would be to convert a noteOn to an ADSR envelope which modulates a MIDI CC, then tie that filter cut-off to the CC?
Exactly!!! I would appreciate if you take some time and create something like that, unfortunately i have zero skills to coding :s
_TIP_ is offline   Reply With Quote
Old 05-13-2014, 11:37 PM   #8
Xzyt_Now
Human being with feelings
 
Xzyt_Now's Avatar
 
Join Date: Feb 2013
Location: London, ON
Posts: 54
Default

I have been looking around for solutions to this all consuming problem for a while now. The two most satisfying thing I've come upon are:

1) Midi-Shaper -- solid product Check it out. (Also Volume shaper by the same company) Only 30 bucks.

2) Using an Envelope Follower then using the ASDR on a synth to control the Envelope > to CC > to Volume device.

But there in lie's the next problem, what device to use to modulate the volume... I think the answer is a bit trickier than one might initially imagine as the quality seems to vary and have different flavors for each...
__________________
Sounds are like bubbles of silence;
The best ones have little square rainbows.
Xzyt_Now is offline   Reply With Quote
Old 05-13-2014, 11:49 PM   #9
Xzyt_Now
Human being with feelings
 
Xzyt_Now's Avatar
 
Join Date: Feb 2013
Location: London, ON
Posts: 54
Default

3)Midi-Dadsr ;-)

This thing is pretty awesome, definitly gonna get some use by me!!
__________________
Sounds are like bubbles of silence;
The best ones have little square rainbows.
Xzyt_Now is offline   Reply With Quote
Old 05-15-2014, 02:46 PM   #10
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Okay, so I've thrown together something that I *think* works. I'm not going to have the chance to beta test it for several days, so I'm hoping that maybe one of you can. Report back whatever bugs come up and I'll do my best to fix it.

If "velocity-sensitive" is off, then max CC value is 1 (0 dB).

https://stash.reaper.fm/v/20673/midi2ccADSR.zip
SaulT is offline   Reply With Quote
Old 05-17-2014, 12:29 AM   #11
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Quote:
Originally Posted by SaulT View Post
Okay, so I've thrown together something that I *think* works. I'm not going to have the chance to beta test it for several days, so I'm hoping that maybe one of you can. Report back whatever bugs come up and I'll do my best to fix it.

If "velocity-sensitive" is off, then max CC value is 1 (0 dB).

https://stash.reaper.fm/v/20673/midi2ccADSR.zip
Thank you so much SaulT!!! So, i just tried your midi2ccADSR plugin and it seems that is not working for me (i might doing something wrong...), the plugin is communicating with the CC but the ADSR controls they are not working, it Just locks the prefered CC (filter freq in my situation) to it's minimum Value...
What i did was:
1)Adding the adsr first
2)Adding a Samplomatic and loading a synth sound on it
3)Adding A low pass filter
4)Modulate the filter freq of the filter to a CC 102 with ReacontrolMIDI. The method above works perfectly for me when use the vst plugin MIDIMod instead of your midi2ccADSR.(The bad thing for me is that MIDIMod is only for Win) So i would love to see an in build solution)
If you find some time please take a look, thank you again SaulT :-)
_TIP_ is offline   Reply With Quote
Old 05-19-2014, 04:34 PM   #12
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Try it again, please. I made what is in retrospect a glaring error in the trigger code.
SaulT is offline   Reply With Quote
Old 05-19-2014, 09:58 PM   #13
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Quote:
Originally Posted by SaulT View Post
Try it again, please. I made what is in retrospect a glaring error in the trigger code.
I did, but with the same results :s

This time I've test it simple, i just tried to control the filter Freq(CC 74) of a vsti with your adsrtocc fx
(ADSRCC first - VSTi Second)

For some reason it locks the cc to it's minimum value and the adsr dosn't response at all...

Thank you again SaulT for trying to fix it, i hope you'll find some more time accomplish the mission ;-)
_TIP_ is offline   Reply With Quote
Old 06-06-2014, 07:03 AM   #14
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Any news here?
_TIP_ is offline   Reply With Quote
Old 12-25-2014, 12:20 AM   #15
dwelx
Human being with feelings
 
dwelx's Avatar
 
Join Date: Dec 2014
Location: Karelia, Russia
Posts: 8
Default

Please, look http://forum.cockos.com/showthread.php?t=152382 for the JS plugin with this functionality.
dwelx is offline   Reply With Quote
Old 01-21-2015, 12:00 AM   #16
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 175
Default

Quote:
Originally Posted by dwelx View Post
Please, look http://forum.cockos.com/showthread.php?t=152382 for the JS plugin with this functionality.
O.M.G, thank you so much dwelx!!!
_TIP_ is offline   Reply With Quote
Old 03-26-2020, 01:41 AM   #17
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by _TIP_ View Post
O.M.G, thank you so much dwelx!!!
TIP are you useing dwelx's tool mainly for synth sounds in reasamplomatic?
TonE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.