Finding overlapping MIDI notes

I’ve been using Beeano Midi Player to visualise MIDI tracks on a piano roll for inclusion in piano tutorial videos. As the software doesn’t support the sustain pedal for indicating the duration of a held note, I’ve been extending a note in the MIDI track to occupy the entire held duration, and at the same time, using quantisation. Beeano is a bit temperamental processing overly quantised MIDI tracks, where two held notes of the same pitch that are snug against each other are considered overlapping. Beeano plays the first note, but cuts out for the second overlapping note in the visualisation.

MIDI doesn’t have the concept of a note duration; instead a held note is represented by a MIDI on event at a pitch and a MIDI off event at the same pitch to represent a held note. In addition to the MIDI off event, the MIDI spec also indicates that a zero velocity MIDI note on can also represent the end of a note.

A prevention method for these overlapping notes is to not overly quantise notes such that note ends finish at the same time as the next note (at the same pitch) starts. However, if that is required, instead of checking each note, a quick remediation method is to select all notes in the track using a sequencer, and decrease the length a few ticks.

I found this last step helped immensely with my tracks, but I was still finding the occasional overlapping note when running through Beeano. This could be due to the recording device, but I’m not sure.

To detect these overlapping notes, I wrote a quick Python script that would report on these overlaps. This helps narrow the search down trememdously.

Monophonic filtering using Scripter in Mainstage/Logic Pro

I was recently building a patch in Mainstage where I wanted both a string/pad as well as a bell sound that would accent the top note of each chord that I played. I looked around for a technique to only keep the top note in a chord for Mainstage, and came across this post; but unfortunately the linked site for the Polyphonic Filter was not accessible. But it pointed me towards the Scripter plugin.

The Scripter plugin in Mainstage/Logic Pro allows Javascript to handle the MIDI signal. Based on some examples from Apple, I created the following script, which keeps the top-most note in a chord and silences the lower notes. I put this script just on my bells channel strip, so the string/pad wouldn’t be affected.

The result was a little hit and miss in a live setting – it worked when I played ascending chord progressions, but was inconsistent when playing descending progressions, depending on when my fingers hit the keyboard. The script would be ok in a sequenced performance where you can specify the order of notes being played. I needed it in a live performance; I ended up not using the plugin, and just played the bells accent separately with my right hand and string/pad chords with my left hand.