Exemplo n.º 1
0
def midiEventCallback(devicename, msgAndTime_t, data=None):
    print "vimina/main midiEventCallback", devicename, msgAndTime_t, data
    event, deltatime = msgAndTime_t

    if event[0] < 0xF0:
        channel = (event[0] & 0xF) + 1
        status_int = event[0] & 0xF0
    else:
        status_int = event[0]
        channel = None
    status = statusMap[int(status_int)]
    data1 = data2 = None
    num_bytes = len(event)
    if num_bytes >= 2:
        data1 = event[1]
    if num_bytes >= 3:
        data2 = event[2]

    osc_msg = midiToOsc.convert(devicename, status, channel, data1,
                                data2)  # convert MIDI so OSC
    print osc_msg
    dps.pubsub_api["publish"](devicename, osc_msg)
Exemplo n.º 2
0
def midiEventCallback(devicename, msgAndTime_t, data=None):
    print "vimina/main midiEventCallback", devicename, msgAndTime_t, data
    event, deltatime = msgAndTime_t


    if event[0] < 0xF0:
        channel = (event[0] & 0xF) + 1
        status_int = event[0] & 0xF0
    else:
        status_int = event[0]
        channel = None
    status = statusMap[int(status_int)]
    data1 = data2 = None
    num_bytes = len(event)
    if num_bytes >= 2:
        data1 = event[1]
    if num_bytes >= 3:
        data2 = event[2]

    osc_msg = midiToOsc.convert(devicename, status, channel, data1, data2) # convert MIDI so OSC
    print osc_msg
    pubsub_api["publish"]("osc", osc_msg)
Exemplo n.º 3
0
def midiCallback(devicename, cmd, channel, note, velocity):
    #print "midiCallback", devicename, cmd, channel, note, velocity
    cmd = statusMap[int(cmd)]
    osc_msg = midiToOsc.convert(devicename, cmd, channel, note, velocity) # convert MIDI so OSC
    #print "midiCallback", osc_msg
    mapOscInToOscOut(osc_msg)