i'm on Ubuntu 20, and I use Python 3.9.
I can't put the list of pygame.midi.Input.read to a string, because else, my programm is closed with the output:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
[[[248, 0, 0, 0], 1]]
Exception: b"PortMidi: Bad pointer'"
Exception ignored in: 'pypm.Input.__dealloc__'
Exception: b"PortMidi: Bad pointer'"
so, here, it work:
def truc(myinput):
    while True:
        if myinput.poll():
            event = str(myinput.read(3))
            print(event)
pygame.midi.init()
my_input = pygame.midi.Input(3)
truc(my_input)
but if I add this after the print(event), he won't work
            if '1' in event:
                print('ok')
            else:
                return
Can you help me please?
PROBLEM FOUNDED:
If you got this problem, you just have to don't put any return
See ya
pygame.midi.Input.read can't being a string