modul8.sendMidi correct usage.
  • User avatar
    lotech
    ultim8 member
    Posts: 228
    Joined: Wed Feb 06, 2008 1:26 am
    Location: Auckland, NZ
    Contact:

    modul8.sendMidi correct usage.

    by lotech » Mon May 02, 2011 1:00 pm

    I'm trying to wrap my head around getting my modules to send their state back down midi (like Udart's Two way MIDI)

    Can someone maybe some examples for the sendmidi command?

    modul8.sendMidi(endpoint,channel,message,value1,value2)

    Once I have a working basis to use I think I can modify and duplicate. From what I can tell the endpoint is the midi controller you're talking to, and the channel is, well, the channel. But the message can be string or a number so if its a crossfader is this the number position of the fader (0-127) or something else? What are the 2 values meant to include.

    From the manual:
    It is possible to send midi messages from Modul8 to an external or virtual midi device.
    The function to send midi message is:
    modul8.sendMidi(endpoint,channel,message,value1,value2)
    The endpoint is the name of the device that should receive the message. If you pass an integer instead of a string, it will be the index in the device list (for instance zero for the first device). You can obtain the midi device list, using the modul8.getMidiDestinationsList() function.
    The message can be either directly a numerical message or a string. For string, possible values are: NOTE_OFF, NOTE_ON, POLY_AFTERTOUCH, CONTROL_CHANGE, MODE_CHANGE, AFTERTOUCH, PITCHBEND, SYSTEM.
    The value1 and value2 represents the midi value. Possible values depend of the message type.
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    by anomad » Mon May 02, 2011 4:34 pm

    . i use the following commands to get the proper midi names that modul8 found :

    allMidiDevices = modul8.getMidiDestinationsList()
    print "all midi ", allMidiDevices

    . and i've only send MIDI notes out w/this command :

    modul8.sendMidi(lpName,1,'NOTE_ON',note,val)

    . where
    lpName - a destination from the list of devices from allMidiDevices (above),
    1 - is the channel
    'NOTE_ON' - the type of data
    note - value of MIDI note (0-127)
    val - velocity (i guess) of the MIDI on event


    . try showing thing everything that's happening in DirectEvent() to see how the other controller types

    . hope that helps :)


    -james
    (a nomad. )
  • User avatar
    lotech
    ultim8 member
    Posts: 228
    Joined: Wed Feb 06, 2008 1:26 am
    Location: Auckland, NZ
    Contact:

    by lotech » Tue May 03, 2011 2:10 am

    Great thanks. Will have a mess with this later tonight.

Who is online

Users browsing this forum: No registered users and 4 guests