Beispiel #1
0
 def run(self):
     try:
         rtmidi = mido.Backend('mido.backends.rtmidi')
         input = rtmidi.open_input()
         output = connect('localhost', 8080)
         for message in input:
             output.send(message)
     except:
         print("No input device detected!")
Beispiel #2
0
 def __init__(self, config):
     super(NetworkOutStream, self).__init__(config)
     self.connection = connect(self.host, self.port)
Beispiel #3
0
# install some sdeps
# pip install mido
# pip install python-rtmidi

#

import mido
import random
from mido.sockets import PortServer, connect

# for message in connect('localhost', 8988):
#     print(message)

output = connect('localhost', 8988)
while True:
    message = mido.Message('note_on',
                           note=random.randint(0, 127),
                           velocity=3,
                           time=6.2)
    output.send(message)
Beispiel #4
0
import mido
from mido.sockets import connect
import time

host = 'raspberrypi.local'

def sleep():
    time.sleep(0.001)

while True:
    try:
        with connect(host, 8080) as server:
            with mido.open_input() as input:
                with mido.open_output() as output:
                    while True:
                        for msg in input.iter_pending():
                            server.send(msg)
                        for msg in server.iter_pending():
                            output.send(msg)
                        sleep()

    except Exception as e:
        print(e)
Beispiel #5
0
 def __init__(self, host, port):
     self._host = host
     self._port = port
     print('Connecting to server {} : {}'.format(host, port))
     self._server = connect(host, port)
 def defaultSet(self):
     self.o = connect('localhost', self.port)
     self.masudaDaw = MasudaDawOut(self.ch, self.inst_no, self.score,
                                   self.articuration, self.timeSeriesObj,
                                   self.o)