Sending non-midi note frequencies from MAX

2000's icon

Hello,

Could anyone help? Is it possible to send frequencies, as midi, from MAX that don't correspond to midi note frequencies? Noteout only seems to send exact notes.

Thank you

Source Audio's icon

it depends who would be listenning to your messages.

You can create a sysex string to form a float.

or go traditional way and send notes + pitchbend,

which would work only as MPE.

2000's icon

Hello,

Yes, I've just found the note & pitchbend method. At the moment I think this is OK. Out of curiosity, which object would you use to transmit the sysex string?

Thank you

Source Audio's icon

I would as first convert float32 (frequency) to 8 7bit bytes.

then send 240 nn nn nn nn nn nn nn nn 247 out.

on receiver side revert bits into float.

now depends what you drive with it,

one would need to transmit level too, mimicking

velocity and note on / off.

By the way mpe can transmit 14bit -8192 ~ 8192 pitchbend.

For any microtonal stuff 0- 127 is not enough.

2000's icon

Hello,

Interesting. This would use the mpeformat object? Don't you have any advice about how I go about looking to build this?

Thanks

Source Audio's icon

What exactly ?

To use MPE midi, or sysex ?

choice would depend on what exactly you are trying to do.

And which software would be involved.

If you want to drive signal/frequency based synth,

you don't need midi at all actually.

2000's icon

Would it be possible to have a simple patch that uses MPE to communicate with hardware/software in the same way that note and pitchbend does? Would only certain hardware/software understand MPE?

Source Audio's icon

MPE needs hard or soft that can use it.

Pitch bend is channel message, so all notes follow same pitch values on a channel.

here is mpe with 14 bit pitchbend example

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

you only need to translate your frequency to note and pitchbend amount

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

2000's icon

Hello,

That's perfect.

Thank you very much

2000's icon

Hello,

Sorry to be annoying. Can I ask another question, please? What range do I need to send to bendout? It outputs 0 - 127, right? One of the patches I've found outputs the range 0 -64.

Thank you

Source Audio's icon

in what context ?

7bit pitch bend ranges from 0 - 127, 64 taken as no bend.

that is because 128 values have no middle ....

64 = center or no bend

0 - 63 = 64 values for bends below the center

65 - 127 = 63 values for bends above the center

if you now define bend range to ± 2 semitones

you have 200 cents divided by 64 (makes 3.125 cent per 1 step)

or 200 cents divided by 63 steps (makes 3.1746 cent per 1 step)

is that precise enough for what you need ?

we talked about 14bit bend in previous posts,

which offer much better resolution.

2000's icon

Hello,

Thank you. The piece of equipment I'm using doesn't support MPE, so I'm trying to understand noteout and bendout. So bendout would always operate between 0 - 127? I came across a couple of patches, but neither seemed to use this range, so I was a little confused.

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

Thank you

Edit.

Sorry, I think I misunderstood your earlier post. It would be possible to translate the 14 bit pitchbend amount for bendout?

Source Audio's icon

14 bit bend is by no means limited to MPE.

if your device can receive on multiple midi channels,

then you could use one note and one pitch bend value per midi channel.

that would give you 16 note polyphony.

it does not matter if 7 or 14 bit.

The point is :

pitch bend on a midi channel affects ALL notes on that midi channel.

Now , describe in simple words,

what your device is, if it is multitimbral (can receive on several midi channels)

and what exactly do you want to do ?

Source Audio's icon

here is one example patch.

it uses coll filled with frequencies for 128 midi notes.

14bit pitchbend gets sent using midiformat with hires attribute set to float -1. ~ 1.

one can create randomised detune coll or create own coll with wished frequencies

and read it into coll.

poly sends to 16 midi channels depending on voices in use.

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

you can have simplified patch without poly with selectable midi channel if you prefer that.

2000's icon

Hello,

Fantastic. Thank you. Thank you for the previous patches, also. Just to check. I was reading that pitch bend wheels can have different ranges. This would work regardless of range, right?

Thank you

Source Audio's icon

pitch wheel has only one range min middle max.

If you mean hardware which is not broken.

Pitch bend range is another thing.

You tell the synth to pitch up/down as much

as you want

For example +- 2 semitones, 1 octave ...

2000's icon

Great. Thank you. Yeah, I meant hardware.

Roman Thilenius's icon

each hardware does it different, but most don´t do it at all.

what always works is using pitchbend, and yes, the issue with that is that the range of the pitch bend has to be known in the patch / the same in all patches for the data received to work.

in the sysex realm there is the MTS standard. when a device fully supports that, it offers single note retuning, which even is a realtime message.

then there is the rare case of synths which allow to receive one more byte than normal with note on messages, which is responsible for a tuning offset in cents.
(to make that work for chords, the existence of MPE is required in addition, like mentioned above. same for using regular picthbend messages as a workaorund for generic devices)

MIDI 2.0 has will have per-note-pitchbend as part of the specs, this is basically the same (uses a fourth byte with note ons) and might lead to more machines to have support for that feature.

to send out stuff from max when there is not a specific formatting object for, you´d just send decimal values to midiout. (bytewise, and make sure it is not gonna be interrupted by other data)

2000's icon

OK. Thank you for the message.