Midi message editing (noob) question

deepRED.tv's icon

Hi There,

Noob question here:

I want to convert midi messages. I need to send a midi note. For example:

Message        Chan Data
Note On        1    1    126
Note Off    1    1    64

And convert it to:

Message        Chan Data
Note On        1    126    1
Note Off    1    64    1

I want to use the note number for the velocity value and velocity value for the note number of the NOTE ON message. The note off value is ignored in my system.

Ive done some work on it but can't get it to work properly:

Ive created a midi parse object and connected it to an unpack object. I then connected the first output of the unpack object to the second output of a pack object and connected the second output of the unpack object to the first output of the pack object. I then connected the output of the pack object to a midi format object. See the attached file. This give erratic results. I noticed in my midi monitor that every time ONE note on OR off message is sent this patch generates a note AND off message. It doubles the information!?

So when I send this:
Message        Chan    Data
Note On        1    1    126
Note Off    1    1    64

I get this:

Message     Chan    Data
Note Off    1    126    64
Note On        1    126    1
Note Off    1    0    64
Note On        1    0    1

Hope you can help!

(Don't ask me why I want to do this. Its a limitation of my lighting desk that i'm trying to solve)

Manuel

Note-on-invert.amxd
amxd
gbravetti's icon

EDIT: I didn't see that you want to filter note-off messages, you can filter those after [pack] using a [Route 64] then connecgt the midi parse to [Route]´s right output.

Your problem is that you are feeding the pack's left input first.

Each tie you get a value at the pack's left input the package is triggered. You need to feed first the pack's right's input then the left input to get a proper pack.

A solution could be to hold the value that goes in the [pack]'s right input on a [message] or [int] object then trigger it after feeding the right [pack]'s input.
.

Best

Note-on-invertbravetti.amxd
amxd
julynessi's icon
deepRED.tv's icon

Hi Gustavo,

Thank you for your input. Actually I don't need to filter the note messages out. My system just ignores them.

I have run the patch you made and found that it, just like my patch, outputs two note on and two note off massages for every individual note on-off message it receives.

Input:
11:55:15.779    To Session 1    Note On     1    1    50
11:55:15.904    To Session 1    Note Off 1    1    64

Results in output:
11:56:14.809    To Session 1    Note Off    1    50    64
11:56:14.809    To Session 1    Note On    1    50    1
11:56:14.934    To Session 1    Note Off    1    0    64
11:56:14.934    To Session 1    Note On    1    0    1

How can I make sure it does not do that?

Thanks again for your input!

deepRED.tv's icon

Hi Julinessi,

Thank you for you input.

I've made the patch you suggested. See the attachment. The patch does not transmit any midi. Maybe i've made a mistake. Could you take e look?

Thanks!

convert-note-to-velocity.amxd
amxd
gbravetti's icon

My patch is not sending duplicates.

You must have something else that is doing that.

I just added a monitoring function to the patch s!o you can see for yourself.

Best!

Note-on-invert-bravetti-with-monitor.amxd
amxd
deepRED.tv's icon

Hi Gustavo,

Its very strange. Indeed you are right that the monitoring function in m4l does not print the extra Note On and Off messages but when I use an external app: http://www.snoize.com/MIDIMonitor/ The extra messages do show up and most importantly: my lighting system picks them up also....

gbravetti's icon

I see, I'll try later with the external app.

gbravetti's icon

Ok, the max patch is fine, I testes as stand alone and there are no duplicates.

It is Ableton the one who is adding note off events probably to avoid endless notes our something.

What I suggest to you is to create a standalone app and send MIDI from Live to that app using UDP ports.

That works and it is very reliable, I use this method on my live shows.

If you need help with that just let me know.

Best!

gbravetti's icon

or... you can generate an extra note off for each new note on, may be this can work also.

deepRED.tv's icon

Trying to make a stand alone app but can't seem to make one. I only have m4l and not Max-MSP. Is it a restricted feature?

gbravetti's icon

there you have, the modded device and the standalone, good luck!

deepRED.tv's icon

Hi Gustavo,

Thanks for your massive input so far...!

When I run your Ableton and play 4 midi notes sequentially tuned from note 1 to 4 without using your app I get this result when view the output with: http://www.snoize.com/MIDIMonitor/

CH Note Vel
15:53:28.771    To Port 1    Note On     1    1    1
15:53:28.896    To Port 1    Note Off    1    1    64
15:53:28.896    To Port 1    Note On     1    2    1
15:53:29.021    To Port 1    Note Off    1    2    64
15:53:29.021    To Port 1    Note On     1    3    1
15:53:29.146    To Port 1    Note Off    1    3    64
15:53:29.146    To Port 1    Note On     1    4    1
15:53:29.271    To Port 1    Note Off    1    4    64

When I use you app I get this result.

CH Note Vel
15:50:09.182    To Port 1    Note On     1    1    1
15:50:09.299    To Port 1    Note On     1    0    1
15:50:09.299    To Port 1    Note On     1    1    2
15:50:09.426    To Port 1    Note On     1    0    2
15:50:09.426    To Port 1    Note On     1    1    3
15:50:09.554    To Port 1    Note On     1    0    3
15:50:09.554    To Port 1    Note On     1    1    4
15:50:09.682    To Port 1    Note On     1    0    4

I think there is something going on with the note off commando. It is converted to a note on. That does not need to happen... My desk listens al all the note on commandos so it will also respond to the extra messages...

What can i do to fix this?

Cheers,

Manuel

gbravetti's icon

just filter the note off events placing a [route 0] after the [pack] and connecting the right output to the [udpsend]

Note-on-invertbravetti-4udp.amxd
amxd
deepRED.tv's icon

Hi Gustavo,

Do you have a pay pall account?

gbravetti's icon

Hey Deepred.tv,

Appreciated but there is no need of any kind of donation or whatever, just remember eventually to help someone ;)
...may be a like to my Facebook fan page? :P http://facebook.com/gustavobravettilive

heheh, don´t worries, and don't hesitate on ask if you need anything else.
best!

deepRED.tv's icon

ok, understood.

THANKS!

If you want you can keep up to date on my work at:

facebook.com/deepred.tv

deepRED.tv's icon

Hi Gustavo,

One last question on the plugin. Now it blocks the original midi message. For my application ti would be more practical If I can send the original data AND the inverted message. Is this something you could implement?

Cheers,

Manuel