Advertisement
Guest User

mididings-midi-osc.py

a guest
Feb 28th, 2017
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.26 KB | None | 0 0
  1. # Get the mididings and OSC stuffs
  2. from mididings import *
  3. from mididings.extra.osc import SendOSC
  4.  
  5.  
  6. # Set up the OSC port
  7. #(you define it in non-mixer thanks to  "--osc-port=15159" option - no quotes)
  8. port = 15159
  9.  
  10. #The actual conversion stuff
  11. run(
  12.    Filter(CTRL) >> CtrlSplit({
  13.        # Non-mixer maping
  14.        #It's always : /strip/[strip_name]/[effect_name]/[control_name]
  15.        #Non-mixer uses values from 0.0 to 1.0. Therfore you have to divide by 127
  16.        # Caution : 127.0 ( .0 !!). Check 'python's promotion' if you want to know why.
  17.  
  18.        #Pan Knobs for sends and sub mixes
  19.        16: SendOSC(port, '/strip/PreMix/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  20.        17: SendOSC(port, '/strip/VoipSend/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  21.  
  22.  
  23.        #Fader Volumes
  24.        1: SendOSC(port, '/strip/Mic/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  25.        2: SendOSC(port, '/strip/Guitar/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  26.        3: SendOSC(port, '/strip/Acoustic/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  27.        4: SendOSC(port, '/strip/Bass/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  28.        5: SendOSC(port, '/strip/Game/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  29.        6: SendOSC(port, '/strip/Music/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  30.        7: SendOSC(port, '/strip/Voip/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  31.        8: SendOSC(port, '/strip/System/Gain/Gain%20(dB)', lambda ev: ev.value / 127.0),
  32.  
  33.        # Mute Buttons
  34.        48: SendOSC(port, '/strip/Mic/Gain/Mute', lambda ev: ev.value / 127.0),
  35.        49: SendOSC(port, '/strip/Guitar/Gain/Mute', lambda ev: ev.value / 127.0),
  36.        50: SendOSC(port, '/strip/Acoustic/Gain/Mute', lambda ev: ev.value / 127.0),
  37.        51: SendOSC(port, '/strip/Bass/Gain/Mute', lambda ev: ev.value / 127.0),
  38.        52: SendOSC(port, '/strip/Game/Gain/Mute', lambda ev: ev.value / 127.0),
  39.        53: SendOSC(port, '/strip/Music/Gain/Mute', lambda ev: ev.value / 127.0),
  40.        54: SendOSC(port, '/strip/Voip/Gain/Mute', lambda ev: ev.value / 127.0),
  41.        55: SendOSC(port, '/strip/System/Gain/Mute', lambda ev: ev.value / 127.0),
  42.        32: SendOSC(port, '/strip/VoipSend/Gain/Mute', lambda ev: ev.value / 127.0),
  43.  
  44.  
  45.  
  46.  
  47.  
  48.    })
  49. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement