I am trying to make a patch that interprets the MIDI data I send it into class objects that are then represented visually.
Per MIDI note played, two messages are sent - a note-on and a note-off (both containing channel, pitch and velocity data). I am trying to add a note object to an ArrayList when a note-on message is received and then subsequently, to remove that same object when this note's corresponding note-off message is received. Here is my problem...
Adding note objects to an ArrayList when a note-on message is received doesn't seem to be the problem, the problem is removing the corresponding object. I think I need to compare the note-off message received with the note objects contained in the array list, removing the note object that corresponds - but doing this has proved to be well beyond my programming abilities.
Below is what I have so far, I'd be very grateful for any help you could provide.