Last active
May 28, 2018 23:14
-
-
Save yarogniew/6909e43f1d8f2f9174de3963b6781e2b to your computer and use it in GitHub Desktop.
Pyo RawMidi monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyo import * | |
import time | |
num = eval(input("Enter your Midi interface number: ")) | |
s = Server(duplex=1) | |
s.setMidiInputDevice(num) | |
s.boot() | |
s.start() | |
def event(status, data1, data2): | |
print(status, data1, data2) | |
a = RawMidi(event) | |
again = "y" | |
while again == "y": | |
time.sleep(10) | |
a.stop() | |
again = input("Do you want to continue ? (y/n) : ") | |
if again == "y": | |
print("Continue...") | |
a.play() | |
s.stop() | |
time.sleep(1) | |
exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment