So I'm using this function to detect events from my MIDI keyboard which then get printed out as sheet music:
for e in events:
if
if e.type in [pygame.midi.MIDIIN]:
This returns 2 events, one when the key is pressed down and one when it is pressed up.This works great for individual notes because I just create a function to only make the if statement trigger every other time there is an event but it's difficult for chords because the events could be coming in a variety of order note 40 keydown, note 41 keydown, note 41 key up, note 40 key up. or note 40 down, note 41 up, note 40 down, note 41 up. Etc etc. Except it doesnt say 'key up' or 'key down' it just triggers the if statement. So my question is is there a function that will only get triggered on the key being pressed either down or up? something like pygame.midi.MIDI_KEYDOWN