In addition I tried to update to pygame 2.0.1 however it is the same. you'll find here after the complete outcome on the terminal:
Python 3.8.2 (default, Nov 4 2020, 21:23:28)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame.midi
pygame 2.0.1 (SDL 2.0.14, Python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
>>> pygame.midi.init()
>>> pygame.midi.get_count()
2
>>> pygame.midi.get_device_info(0)
(b'CoreMIDI', b'P\x8eriph\x8erique MIDI USB', 1, 0, 0)
>>> midiin1 = pygame.midi.Input(0)
>>> pygame.midi.get_device_info(0)
(b'CoreMIDI', b'P\x8eriph\x8erique MIDI USB', 1, 0, 1)
>>> midiin1.close()
>>> pygame.midi.get_device_info(0)
(b'CoreMIDI', b'P\x8eriph\x8erique MIDI USB', 1, 0, 1)
>>> midiin1 = pygame.midi.Input(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/familleaupepin/Library/Python/3.8/lib/python/site-packages/pygame/midi.py", line 287, in __init__
self._input = _pypm.Input(device_id, buffer_size)
File "src_c\cython\pygame\pypm.pyx", line 547, in pygame.pypm.Input.__init__
Exception: b"PortMidi: `Invalid device ID'"
>>>