For Christmas I have been given (very kindly!) a Kawai CL26 Digital Piano. In order to feel more deserving of this amazing instrument I've been planning to record my practise session times in order to amortize the cost (in a sense).
But why not simply record everything?
My USB/MIDI converter works with raspbian without any extra plugins. Then, using Pygame.midi I can see incoming MIDI information in a polling loop:
But why not simply record everything?
My USB/MIDI converter works with raspbian without any extra plugins. Then, using Pygame.midi I can see incoming MIDI information in a polling loop:
import pygame.midi
import time
pygame.midi.init()
inputKeyboard = pygame.midi.Input(3)
# this is the device id for the midi input, worked out by doing
# pygame.midi.get_device_info(1-n)
while 1 == 1:
while inputKeyboard.poll() == True:
print(inputKeyboard.read(1))
time.sleep(0.001)
inputKeyboard.close()
pygame.midi.quit()
Comments
Post a Comment