simple midi transpose

Chalisque's icon

I want to make a m4l device which transposes incoming midi note messages, but passes through all other midi unmodified. (The transpose amount will be send from a single m4l device, and received by multiple. Stuck notes aren't an issue as I will stop the sequencer before changing the transpose amount.)

I have something that I think works. It assumes that all note messages come on channel 1 (i.e. first byte is 144). But this doesn't seem like a robust way of doing this.

Here is the current patcher.

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

Have a look at another example.
using notein makes it a bit simpler,
but main difference is
flush whenever transposing factor changes to avod hanging notes.
and prevent that pitch values exceed midi limits - using split 0 127

you can remove notein channel argument if you don't need to stick

with any midi channel