Jump to content

Is there any midi effect or external midi utility to automatically lengthen notes in real time?


wing
 Share

Go to solution Solved by Dewdman42,

Recommended Posts

Sounds kinda crazy, but basically I have a drum pad (Roland SPD-SX) which when I play midi from, I've observed in the event list the length of each note is on average 1-2 (ticks? not sure what the measurement is). Attaching screengrab below.

Then if I play the same notes from my keyboard controller (NI Kontrol S49ii) at the *same speed* more or less (these were pretty fast 16th & 32nd notes!), the length of each note is typically 80-100+.

The problem is, while some instruments have no issue with the 1-2 length notes, I'm noticing some instruments will not fire - they must have a threshold of how long a note has to be in order to actually play.

In theory I can record something on the pads and then lengthen all the notes afterwards and it will work, but that's not only tedious but also would make playing along very difficult if you can't hear all the notes...

I couldn't find an effect in the midi list that would modify this. However there is a "scripter" tool. I'm not a coder but curious if anyone has an idea how I could force all input notes to have a minimum value? This way I could just add that script as a midi effect before an instrument with that issue and I'll be good to go.

I want to be clear this isn't a Logic issue per se, just that Logic is my DAW of choice. Same thing happens in Ableton. There's no adjustments on the drum pads that I have found that can lengthen input notes either. So if anyone can suggest a midi utility for mac that could accomplish this, let me know! Thanks :)

 

Midi Events recorded from SPD.png

Midi Events recorded from Keyboard.png

Link to comment
Share on other sites

It depends what type of "Note Off" event the pads are sending? 

Open a MIDI Environment window and in the Clicks & Ports layer look at the Monitor as you hit a pad. You should see a Note on and a Note off events in the Monitor. Can you post a screenshot of that Monitor here? 

Link to comment
Share on other sites

I got a little lost looking for this because I'm not so familiar with the midi environment, but I think I found it? See attached screengrab.

If it helps I also have the Snoize Midi Monitor which I've screengrabbed two separate hits, both of G1, the first from the drum pad and the second from the keyboard. Perhaps it's of interest that the note off value for the SPD and the keyboard are different (0, 127 respectively). But as far as my limited understanding about midi goes, note off of any velocity value shouldn't matter?

Screen Shot 2022-09-14 at 3.27.42 PM.png

Screen Shot 2022-09-14 at 3.31.26 PM.png

Link to comment
Share on other sites

  • Solution

I think a quick and dirty would be just delay NoteOff events by a little bit..and that should solve the issue.  Easy in Scripter....there are some noteOff quirks in the environment which may or may not come up if done that way but I'm sure it can be done there too.

 here is a scripter script that would do it.

 

var DELAY = 100;   // in ms

function HandleMIDI(event) {
    if(event instanceof NoteOff ||
            (event instanceof NoteOn && event.velocity < 1)) {
        event.sendAfterMilliseconds(DELAY);
    }
    else {
        event.send();
    }
}

 

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Dewdman42 said:

I think a quick and dirty would be just delay NoteOff events by a little bit..and that should solve the issue.  Easy in Scripter....there are some noteOff quirks in the environment which may or may not come up if done that way but I'm sure it can be done there too.

 here is a scripter script that would do it.

var DELAY = 100;   // in ms

function HandleMIDI(event) {
    if(event instanceof NoteOff ||
            (event instanceof NoteOn && event.velocity < 1)) {
        event.sendAfterMilliseconds(DELAY);
    }
    else {
        event.send();
    }
}

Cool, that works perfectly! Saving into my preset menu for easy recall later on.

Should I be at all aware of or concerned of any latency issues presented as a result of using it (since it adds a delay)? I mean to my ears it sounds fine, but just curious.

Thanks!

Link to comment
Share on other sites

You can change the delay to less than 100ms, just change that value on the first line of the script to the shortest value that solves your problem.  I don't think you you will have any latency issues as only the Noteoff events are being affected by the delay.  

Link to comment
Share on other sites

and by the way for reference, at 120bpm, each midi tick is approximately 0.5ms

another thing you might want to try instead of this script is configuring the plugin you are using to make sound.  Because some drum related sample players will have an option to choke off the note when the noteOff comes in, or optionally to always let the full percussion sound complete...with the understanding that there is basically no sustain time and regardless of when NoteOff comes, let the note complete through the full release.  not all percussion instruments work that way or provide ability to configure, but anyway, probably your sound source is observing the 2 midi tick duration and choking off the notes when the short duration happens that is shorter then the actual sound needs.

Edited by Dewdman42
Link to comment
Share on other sites

I made the script to 100ms to make sure it would work, but I agree, it can probably be much much shorter...  Depends on his sound sources probably.  because if the NoteOff's are choking off the sound, then the delay needs to be long enough to handle the longest sustaining sounds such as cymbals for example to work in a simple script.

You could make it more robust by providing different delay amounts for each pitch so that shorter sounding pitches would not need much delay while cymbals might need more to get around the fact that midi controller is sending short durations in all cases.

Of course a more elaborate script could check for overlapping midi events, because if you have any two notes closer together then 100ms of the same pitch (or whatever shorter value you might use), then the second one would get cut off by the delayed NoteOff of the first one.  its possible to code around that, but I don't have time to do it now sorry.

The environment is great for recording the result of course.  there are several complications in the environment, one is that NoteOff's from live midi vs sequenced midi can cause the Transformer and other things to have problems.  hard to say without digging into it, but I just know there are issues in the environment in this way.  Also, the environment will have the same problem about overlapping midi notes and would be more complicated to "code around" then even doing it in scripter.  There was another problem with the environment approach that I was thinking of earlier but I can't remember right now. 

Anyway, both approaches are worth consideration.

Good luck.

Link to comment
Share on other sites

13 minutes ago, fuzzfilth said:

The note length of the SPD-X can be adjusted in MENU>KIT>MIDI>GATE between 0.1 and 8.05 seconds individually for every pad.

Cool, yeah I actually found out about this after intensive searching – but it's not just that, in my case anyway I have to set EXT CTRL to 'ON'. That combination appears to be the magic formula, otherwise gate length won't make a difference. Most of my gates around 1.0s seem to work great.

  • Like 1
Link to comment
Share on other sites

7 minutes ago, Dewdman42 said:

I made the script to 100ms to make sure it would work, but I agree, it can probably be much much shorter...  Depends on his sound sources probably.  because if the NoteOff's are choking off the sound, then the delay needs to be long enough to handle the longest sustaining sounds such as cymbals for example to work in a simple script.

You could make it more robust by providing different delay amounts for each pitch so that shorter sounding pitches would not need much delay while cymbals might need more to get around the fact that midi controller is sending short durations in all cases.

Of course a more elaborate script could check for overlapping midi events, because if you have any two notes closer together then 100ms of the same pitch (or whatever shorter value you might use), then the second one would get cut off by the delayed NoteOff of the first one.  its possible to code around that, but I don't have time to do it now sorry.

The environment is great for recording the result of course.  there are several complications in the environment, one is that NoteOff's from live midi vs sequenced midi can cause the Transformer and other things to have problems.  hard to say without digging into it, but I just know there are issues in the environment in this way.  Also, the environment will have the same problem about overlapping midi notes and would be more complicated to "code around" then even doing it in scripter.  There was another problem with the environment approach that I was thinking of earlier but I can't remember right now. 

Anyway, both approaches are worth consideration.

Good luck.

Thanks! I'm lucky I was able to figure out how to extend the notes in SPD-SX settings (EXT CTRL - ON, Gate Length - 1.0s+). When I view the event list notes are as long as my keyboard and in any case, the libraries which were giving me an issue work fine this way.

However I think the script is great to keep around in a pinch, if I'm in a hurry and don't have time to SPD menu-dive and tweak each and every pad etc. Or in the case this comes up with any other external controller. I appreciate you taking the time to write it and explain!

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...