A technical support community for Apple Logic Pro users.

 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Slew/Glide for Aftertouch/Midi CC

Sun Jun 28, 2020 12:39 am

Hey everyone, this site has been a fantastic source of knowledge through the years, yet this is my first post ever.

I been toying around with a Roli controller and I’ve encountered that the aftertouch (and many other keyboards) tends to be way too abrupt and inexpressive.

Using Alchemy’s envelope follower or Kontakt’s lag has helped a lot but not all plugins are as easy to workaround, hence this post.

I’m wondering if there is a way to script a midi message like aftertouch to midi cc with lag/smooth/glide (attach and decay could be useful too) functions to smooth out the abrupt changes. Minimum and maximum values would be great too. I know a little bit of code but this has been way out of my league.

Polyphonic aftertouch would be great also but probably a nightmare to script.

This slew/glide script could also help with jumpy cc midi cc data and make it smoother.

Looking forward to all your comments and suggestions, thanks in advance!
Last edited by eserpa on Tue Jun 30, 2020 9:11 pm, edited 4 times in total.
 
User avatar
Mark R
Posts: 386
Joined: Thu Jan 26, 2006 9:50 am
Location: Tumwater, WA

Re: Slew/Glide for Aftertouch/Midi CC

Sun Jun 28, 2020 8:05 am

Agreed, aftertouch is often way too touchy to be usable.
I too would like a way to slow down (slew) aftertouch messages...
Preferably with separate Attack and Release time controls.
Logic 10.5.1 | Mojave | retina iMac 4GHz i7 32GB
Logic 10.4.8 | High Sierra | MacMini 2.3GHz, i7 16GB
 
User avatar
fuzzfilth
Posts: 3695
Joined: Mon Aug 03, 2009 2:31 am
Location: Germany

Re: Slew/Glide for Aftertouch/Midi CC

Sun Jun 28, 2020 8:25 am

Here's one concept:
- receive an AT event
- if it's the first AT event, store it in "currentAT"
- also store it in "lastAT"
- pause for "lagMS"
- if lastAT > currentAT, increase currentAT by 1
- if lastAT < currentAT, decrease currentAT by 1
- send currentAT
- if another AT event has come in in the meantime, store it in lastAT
- if currentAT ≠ lastAT, jump to the pause for lagMS line

lagMS is your ramp speed control, you can set up a GUI fader for this. Start with a center value of, say, 5ms, this will spread 127 steps over 640ms.

I'm sure there's more elegant ways to code this, but this can get you started.
Christian Obermaier
Contact me for private Logic Consulting, Training, Troubleshooting via Skype, Zoom or Teamviewer

1 x MacPro 6core 2010 24Gb RAM
2 x MacBookPro i7 2012 16Gb RAM
OSX.14.6. Mojave, Logic X.4.4 & 5.1
 
User avatar
Dewdman42
Posts: 2510
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Slew/Glide for Aftertouch/Midi CC

Sun Jun 28, 2020 12:19 pm

eserpa wrote:
I’m wondering if there is a way to script a midi message like aftertouch to midi cc with lag/smooth/glide functions to smooth out the abrupt changes. Minimum and maximum values would be great too. I know a little bit of code but this has been way out of my league.


Please describe what you mean exactly by "lag/smooth/glide".

Polyphonic aftertouch would be great also but probably a nightmare to script.


its not really that hard
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
Dewdman42
Posts: 2510
Joined: Tue Sep 09, 2014 3:01 pm
Location: Park City, UT

Re: Slew/Glide for Aftertouch/Midi CC

Sun Jun 28, 2020 4:55 pm

so one quick fix for now...might be to use this site and adapt it:

https://sumire-io.gitlab.io/midi-veloci ... generator/

gen.jpg
gen.jpg (197.84 KiB) Viewed 510 times


You can basically drag the curve to a velocity curve you like and then copy and paste the javascript into Scripter. But in order to work with aftertouch, you'd need to modify the code slightly.. Modify just the HandleMIDI function more like this:

function HandleMIDI(event) {
  if(event instanceof ChannelPressure) {
    event.value = velocities[event.value];
  }
  event.send();
}


Play around with different aftertouch scaling curves until maybe it responds the way you want it too.

If you want to elaborate more on what you had in mind for glide, etc.. I can comment more...
5,1 MacPro 3.46ghz x 12 128gb ram, OSX 10.14, Logic Pro 10.4.8, Mainstage3, Cubase10, StudioOne, Reaper, DP9, VEP, VSL, too many plugins to list
 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Re: Slew/Glide for Aftertouch/Midi CC

Tue Jun 30, 2020 6:25 pm

Thank you so much! This will definitely get me started.
 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Re: Slew/Glide for Aftertouch/Midi CC

Tue Jun 30, 2020 6:29 pm

Dewdman42 wrote:
eserpa wrote:
I’m wondering if there is a way to script a midi message like aftertouch to midi cc with lag/smooth/glide functions to smooth out the abrupt changes. Minimum and maximum values would be great too. I know a little bit of code but this has been way out of my league.


Please describe what you mean exactly by "lag/smooth/glide".

Polyphonic aftertouch would be great also but probably a nightmare to script.


its not really that hard


What I mean is that these changes in pressure are far to abrupt to be musical in most situations in my opinion. It is a great to have if you want to do a fast swell or transition fx but for evolving and smooth filter cutoffs it tends to be too fast.
 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Re: Slew/Glide for Aftertouch/Midi CC

Tue Jun 30, 2020 6:30 pm

Dewdman42 wrote:
so one quick fix for now...might be to use this site and adapt it:

https://sumire-io.gitlab.io/midi-veloci ... generator/

gen.jpg

You can basically drag the curve to a velocity curve you like and then copy and paste the javascript into Scripter. But in order to work with aftertouch, you'd need to modify the code slightly.. Modify just the HandleMIDI function more like this:

function HandleMIDI(event) {
  if(event instanceof ChannelPressure) {
    event.value = velocities[event.value];
  }
  event.send();
}


Play around with different aftertouch scaling curves until maybe it responds the way you want it too.

If you want to elaborate more on what you had in mind for glide, etc.. I can comment more...


What an interesting solution. Thanks again for being super helpful. Will test all these options and report back!
 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Re: Slew/Glide for Aftertouch/Midi CC

Tue Jun 30, 2020 6:40 pm

Mark R wrote:
Agreed, aftertouch is often way too touchy to be usable.
I too would like a way to slow down (slew) aftertouch messages...
Preferably with separate Attack and Release time controls.


Yes! I think this would be great too. Logic's Alchemy has Attack Release and Scale, personally scale is usually at 100% but over scaling could interesting too, a great way yo make it smooth but have a shorter span of pressure.

Thanks to everyone, I don't know why I didn't joined this community sooner, what a great forum!
 
User avatar
eserpa
Topic Author
Posts: 7
Joined: Sun Jun 28, 2020 12:28 am
Location: Los Angeles
Contact:

Re: Slew/Glide for Aftertouch/Midi CC

Tue Jun 30, 2020 9:09 pm

fuzzfilth wrote:
Here's one concept:
- receive an AT event
- if it's the first AT event, store it in "currentAT"
- also store it in "lastAT"
- pause for "lagMS"
- if lastAT > currentAT, increase currentAT by 1
- if lastAT < currentAT, decrease currentAT by 1
- send currentAT
- if another AT event has come in in the meantime, store it in lastAT
- if currentAT ≠ lastAT, jump to the pause for lagMS line

lagMS is your ramp speed control, you can set up a GUI fader for this. Start with a center value of, say, 5ms, this will spread 127 steps over 640ms.

I'm sure there's more elegant ways to code this, but this can get you started.


Gosh I wish I knew more Java. But these variables sound like they would do the trick.