How to send MPE notes

Post Reply New Topic
RELATED
PRODUCTS

Post

Hello

I'm trying to write a control script to turn any MIDI keyboard (or otherwise-shaped controller) into a microtonal / xenharmonic input device, adding to the notes an automatically-computed per-note pitch bend.

The basic idea is to intercept note-on and -off events, handle them in the midi callback, and send appropriate MPE events, with per-note pitch-bend, using noteIn.sendRawMidiEvent()

(Yes, I know that handling note events in the script will introduce a random latency. Right now I'm more interested in an easy-to-code solution that will get me all the right pitches, rather than a difficult-to-code solution, in C++ or whatever, that will preserve the exact timing. That can come later.)

But I can't get it to work, because of 2 issues:

1. How to stop BWS from getting the original notes.

No matter what I pass as a 3rd argument to midiIn.createNoteInput (I've tried: no 3rd argument; empty string; impossible pattern such as 'ffffff') BWS will still get the original notes, in addition to the ones I send with noteIn.sendRawMidiEvent().

2. How to send MPE events.

I've tried the obvious: enabling MPE with noteIn.setUseExpressiveMidi(true, 15, 96) and sending pitch bend, note-on and note-off events (with noteIn.sendRawMidiEvent) that include a channel, selected with a certain logic. But the MPE / channel information seems to be discarded, because the pitch bend events apply to all notes.

What am I doing wrong?

I'm using 2.4.3 build date 2018-11-21

Post

Do you assign the correct Midi channels in your polyphonic voice allocation? MPE is about changing the Midi channel per voice...

Post

Could your potential solution be used in other daws?
I'd be interested in trying it in Studio One 4.

Post

Only if Studio 4 has the ability to be scripted with Javascript and has the same API. I would say this is unlikely. But you could get all inspiration you need from it...

Post

I have a lot to learn about mpe.
Would a midi guitar controller have some of that functionality already?
(back to original topic)

Post

Tj Shredder wrote: Tue Dec 18, 2018 8:23 am Do you assign the correct Midi channels in your polyphonic voice allocation? MPE is about changing the Midi channel per voice...
Yes, I do. For example, here are 3 note-on messages I got from my controller and the new messages I send to BWS:

Code: Select all

got 90 33 66
send e0 00 39
send 90 39 66

got 90 42 6a
send e1 00 48
send 91 48 6a

got 90 51 34
send e2 00 57
send 92 57 34
In each case I'm receiving note-on messages on channel 0 (note no. 33, 42, 51) and posting altered messages (note no. 39, 48, 57) on different channels (ch no. 0, 1, 2) along with a pitch bend for the relevant channel.

But the result looks like this:

Image

(1) are the original notes, that were passed through to BWS even though my controller script asked BWS not to (see problem 1. in OP)

(2) are the bitch bends getting changed by the arrival of a new note, even though each pitch bend was sent in its own channel (see problem 2. in OP)

Musical Gym wrote: Tue Dec 18, 2018 8:42 am Could your potential solution be used in other daws?
I'd be interested in trying it in Studio One 4.

If I cannot get it to work as a BWS controller script and if I can put in the time and effort to code it as a standalone application, applied as a filter between virtual midi ports, then yes it could be used with any DAW. The general idea is certainly applicable to any DAW that supports the new MPE standard (and does not support custom/alternative tuning systems.)

Musical Gym wrote: Tue Dec 18, 2018 8:57 am I have a lot to learn about mpe.
Would a midi guitar controller have some of that functionality already?
(back to original topic)

The official specification is just 16 pages:

https://www.midi.org/specifications-old ... cification

Click on "MIDI Polyphonic Expression" at the bottom. (If you don't have an account and don't care to create it, just use a random one from BugMeNot.com)

If you prefer a generic introduction, here is MPE creator Roger Linn's explanation:

http://www.rogerlinndesign.com/mpe.html

And here is Bitwig's explanation:

https://www.midi.org/articles-old/midi- ... ession-mpe

Basically it's a workaround for the problem of pitch bend and most other controls being "global" to a MIDI track. It turns the "channel number", a 16-valued thingy present in most MIDI messages and currently underused, into a sort of 15-voice polyphony that includes pitch bend and other expressions for every note.

Therefore MPE gives us per-note expressions and pitch bend; in a way that's fully compatible with the MIDI standard; introducing a "progressive degradation" or "graceful fallback" when the number of voices exceed the number of polyphonic channels (usually 15) whereby some of the notes will have to share expression data. But people only have 10 fingers, so that's probably "good enough" in most cases.

A midi guitar controller would be the perfect device for MPE, because you can do all sorts of pitch bends and tricks with guitar strings. But unless the controller is relatively new or has a firmware update available, it's not likely to support it, because the MPE standard was finalized in January 2018.
Last edited by murawa on Wed Dec 19, 2018 2:03 pm, edited 1 time in total.

Post

murawa wrote: Tue Dec 18, 2018 1:07 pmA midi guitar controller would be the perfect device for MPE, because you can do all sorts of pitch bends and tricks with guitar strings. But unless the controller is relatively new or has a firmware update available, it's not likely to support it, because the MPE standard was finalized in January 2018.
Midi guitars controllers which use seperate pickups for each string are kind of naturally MPE compatible. They can send the pitch and bend information on sperate Midi channels which translates perfectly...
The adaption had to be done on the synth side, which is happening more and more...

Post

thanks for tips/info guys, much appreciated

Post Reply

Return to “Controller Scripting”