miditest.py
import sys, os, time, traceback
import ctypes
import pygame.midi
import winreg
pygame.midi.init()
try:
print(pygame.midi.get_device_info(1))
m = pygame.midi.Input(1)
print('Device opened for testing. Use ctrl-c to quit.')
while True:
while m.poll():
print(m.read(1))
time.sleep(0.1)
except:
m.close()
pygame.midi.quit()
This is part of the code of midi2vjoy, it is used to test midi input for later configuration. the line
m = pygame.midi.Input(1)
causes the output
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
(b'MMSystem', b'DDJ-200', 1, 0, 0)
Fatal Python error: (pygame parachute) Segmentation Fault
Python runtime state: initialized
Current thread 0x00003b98 (most recent call first):
File "D:\Python\Python38\lib\site-packages\pygame\midi.py", line 280 in __init__
File "miditest.py", line 9 in <module>
as you can see before the error a midi device exists at that device index and it is an input device. The line 280 in midi.py is
self._input = _pypm.Input(device_id, buffer_size)