Skip to content Skip to sidebar Skip to footer

Pygame Midi Read Pc (program Change) Messages

My goal is to listen to a MIDI to USB adapter that is connected to my guitar pedalboard switcher. When a program change, (PC) message is received, play the appropriate mp2 file. I

Solution 1:

The midis2events() function is pointless if you are not using the event loop.

Just extract the values from the data you have read:

...
read = inp.read(100)
for event inread:
    ((status,data1,data2,data3),timestamp) = event
    ifstatus == 196:
        print(f"change to program {data1}")

Post a Comment for "Pygame Midi Read Pc (program Change) Messages"