Trouble with midi timing and automation

Learn about building and using Max for Live devices.
Post Reply
JEFinster
Posts: 7
Joined: Sun Mar 19, 2023 9:53 am

Trouble with midi timing and automation

Post by JEFinster » Sun Feb 25, 2024 8:50 pm

Hi everyone, maybe you can help me out here.

I have created a m4l device that is supposed to trigger midi notes with other midi notes. The idea is that I insert notes in the midi editor and the device is triggering other notes whenever the inserted notes are played. The note that should be triggered can be selected with a live.menu.
It is working in general but I run into trouble when I try to automate the triggered note selection.

When I try to automate the selection then the notes at the beginning of an automated section don´t trigger the correct notes. The inserted note (notes 1 and 3 in the screenshot) is played first and then the selection is made. This I could fix by delaying the inserted note by 1ms with pipe.
But now the notes at the end (notes 2 and 4 in the screenshot) are not working correctly. They trigger the correct selected note but won´t terminate because the selection of the note happens in between the note on and note off events. So the previous selected note is started, then the new note is selected and then the note off event is combined with the new note and the previous note is playing indefinitely.

I have made several attempts to fix that. E.g. I tried to use a counter and an improvised note buffer to trigger the note off event for the previous note manually. That kinda worked but only half the time.
Another attempt was to delay only the note-on events. That did not work and I do not know what I did wrong.

Live 11.3.21 + Max4Live 8.5.6

Any help appreciated.

Screen 1: Notes in midi editor
Image

Screen 2: The m4l device
Image

Post Reply