diff options
-rw-r--r-- | configs/pyexample.py | 8 | ||||
-rw-r--r-- | configs/scripting-example.cfg | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/configs/pyexample.py b/configs/pyexample.py new file mode 100644 index 0000000..7213005 --- /dev/null +++ b/configs/pyexample.py @@ -0,0 +1,8 @@ +# Import the MIDIMonster Python API +import midimonster + +def channel1(value): + # Print current input value + print("Python channel 1 is at %s" % (value,)) + # Send inverse on py1.out1 + midimonster.output("out1", 1.0 - value) diff --git a/configs/scripting-example.cfg b/configs/scripting-example.cfg new file mode 100644 index 0000000..fb9d6ca --- /dev/null +++ b/configs/scripting-example.cfg @@ -0,0 +1,22 @@ +; Turn on debugging to see what is coming in +[backend osc] +detect = on + +[python py1] +; This will load the pyexample.py script into this instance +module = pyexample + +[lua lua1] +; This will load the print.lua script into this instance +script = print.lua +; This will send all mapped channels to the `printchannel` function in there +default-handler = printchannel + +[osc in] +; Listen on port 8000 and send answers on port 9000 +bind = 0.0.0.0 8000 +dest = learn@9000 + +[map] +in./1/fader1 > py1.pyexample.channel1 +py1.out1 > lua1.lua-input |