Midi note on/off timing

I’m using the excellent MidiNoteOut to build a simple MIDI sequencer. Unfortunately I can’t figure out a nice and clean way to handle note durations - that is - to integrate some kind of buffer that keeps track of all notes that are currently playing, and automatically sends note-off messages (similar to PureData’s makenote). MonoFlop seems to be a part of the solution, but I’m not sure how to use it.

hello, i guess you are just missing the TogEdge (Animation) node… if not, just post your patch, i’m sure someone can help.

Ok, I’m trying to create a general patch wrapping around MIDINoteOut, which will also send note off messages after a specified time.

I’ve attached an outline of a patch of how it could work: using a spread storing the on/off state of all possible notes on all possible channels. MonoFlop is then automatically triggering the note off events. However, I have no idea how to retrieve which index in the spread that bangs! “Intersect” seemed to be one possibility, but it’s not working as I expected (and fills up the memory after some time). Also, without knowing too much about the internal structure of vvvv, isn’t this a processing-heavy solution?

event timer 2.v4p (8.7 kB)