From 4ebcda3a1b0d90c44e91a5dfe455ad59fe694cbe Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 9 Mar 2020 21:31:54 +0100 Subject: Update README and example config --- configs/osc-artnet.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs') diff --git a/configs/osc-artnet.cfg b/configs/osc-artnet.cfg index ab1d767..35b2111 100644 --- a/configs/osc-artnet.cfg +++ b/configs/osc-artnet.cfg @@ -5,7 +5,7 @@ bind = 0.0.0.0 [osc touch] -bind = * 8000 +bind = 0.0.0.0 8000 dest = learn@8001 [artnet out] -- cgit v1.2.3 From daf9ac5b883cf981a163654d58932bfbdce619d9 Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 17 Mar 2020 23:58:06 +0100 Subject: Output routing info to log --- configs/launchctl-sacn.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs') diff --git a/configs/launchctl-sacn.cfg b/configs/launchctl-sacn.cfg index dedfc0f..10a736a 100644 --- a/configs/launchctl-sacn.cfg +++ b/configs/launchctl-sacn.cfg @@ -7,7 +7,7 @@ name = MIDIMonster [backend sacn] -bind = 0.0.0.0 +bind = 0.0.0.0 5568 local [midi lc] read = Launch Control -- cgit v1.2.3 From ee086b47e5171698ed9c221e704120522f6abb73 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 25 Apr 2020 00:23:57 +0200 Subject: Add rtpmidi to README, add example config --- configs/print.lua | 5 +++++ configs/rtpmidi.cfg | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 configs/print.lua create mode 100644 configs/rtpmidi.cfg (limited to 'configs') diff --git a/configs/print.lua b/configs/print.lua new file mode 100644 index 0000000..c6391d3 --- /dev/null +++ b/configs/print.lua @@ -0,0 +1,5 @@ +-- This function prints the name of the channel it handles and it's value +-- It can be used for a simple debug output with the `default-handler` configuration option +function printchannel(value) + print(input_channel() .. " @ " .. value) +end diff --git a/configs/rtpmidi.cfg b/configs/rtpmidi.cfg new file mode 100644 index 0000000..4128274 --- /dev/null +++ b/configs/rtpmidi.cfg @@ -0,0 +1,22 @@ +; Simple RTP MIDI example configuration + +[backend rtpmidi] +; This causes the backend itself to output channel values +detect = on +; When connecting multiple MIDIMonster hosts via RTP MIDI, set this to something else on each computer +mdns-name = midimonster-host + +[rtpmidi rtp] +mode = apple +; Invite everyone we see on the network +invite = * + +; This instance just sends all incoming events to the `printchannel` function +[lua print] +script = print.lua +default-handler = printchannel + +; Map all notes and CC's coming in to the Lua instance +[map] +rtp.ch{0..15}.cc{0..127} > print.ch{0..15}.cc{0..127} +rtp.ch{0..15}.note{0..127} > print.ch{0..15}.cnote{0..127} -- cgit v1.2.3 From ceefbdb7eddfdccd7b1b6cb452f920382cdae4b0 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 25 Apr 2020 00:33:57 +0200 Subject: Fix spelling --- configs/print.lua | 2 +- configs/rtpmidi.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configs') diff --git a/configs/print.lua b/configs/print.lua index c6391d3..dc28bb6 100644 --- a/configs/print.lua +++ b/configs/print.lua @@ -1,4 +1,4 @@ --- This function prints the name of the channel it handles and it's value +-- This function prints the name of the channel it handles and its current value -- It can be used for a simple debug output with the `default-handler` configuration option function printchannel(value) print(input_channel() .. " @ " .. value) diff --git a/configs/rtpmidi.cfg b/configs/rtpmidi.cfg index 4128274..3223bd7 100644 --- a/configs/rtpmidi.cfg +++ b/configs/rtpmidi.cfg @@ -1,9 +1,9 @@ ; Simple RTP MIDI example configuration [backend rtpmidi] -; This causes the backend itself to output channel values +; This causes the backend itself to print channel values as they come in detect = on -; When connecting multiple MIDIMonster hosts via RTP MIDI, set this to something else on each computer +; When connecting multiple MIDIMonster hosts via RTP MIDI, set this to something different on each computer mdns-name = midimonster-host [rtpmidi rtp] -- cgit v1.2.3 From 7693ed34ab5e549b8b7fb8ca395bbf15616d6915 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sun, 26 Apr 2020 02:28:11 +0200 Subject: Update layering config to use the new default-handler functionality --- configs/layering.cfg | 5 ++-- configs/layering.lua | 82 +++++++--------------------------------------------- 2 files changed, 14 insertions(+), 73 deletions(-) (limited to 'configs') diff --git a/configs/layering.cfg b/configs/layering.cfg index 7adcd6f..b71f9e5 100644 --- a/configs/layering.cfg +++ b/configs/layering.cfg @@ -7,7 +7,7 @@ bind = 0.0.0.0 [midi in] -read = Launch Control +read = BCF [artnet out] destination = 255.255.255.255 @@ -15,9 +15,10 @@ universe = 1 [lua layers] script = layering.lua +default-handler = handler [map] -in.ch0.cc{0..15} > layers.in{0..15} +in.ch1.cc{1..8} > layers.in{0..7} layers.out{0..511} > out.{1..512} in.ch0.note0 > layers.control diff --git a/configs/layering.lua b/configs/layering.lua index 5d9458d..5ddde65 100644 --- a/configs/layering.lua +++ b/configs/layering.lua @@ -3,74 +3,14 @@ -- so we have 32 possible offsets (32 * 16 = 512) current_layer = 0 --- Set the current_layer based on the control input channel -function control(value) - current_layer = math.floor(value * 31.99); -end - --- Handler functions for the input channels --- Calculate the channel offset and just output the value the input channel provides -function in0(value) - output("out"..((current_layer * 16)), value) - print("Output on out"..(current_layer * 16)) -end - -function in1(value) - output("out"..((current_layer * 16) + 1), value) -end - -function in2(value) - output("out"..((current_layer * 16) + 2), value) -end - -function in3(value) - output("out"..((current_layer * 16) + 3), value) -end - -function in4(value) - output("out"..((current_layer * 16) + 4), value) -end - -function in5(value) - output("out"..((current_layer * 16) + 5), value) -end - -function in6(value) - output("out"..((current_layer * 16) + 6), value) -end - -function in7(value) - output("out"..((current_layer * 16) + 7), value) -end - -function in8(value) - output("out"..((current_layer * 16) + 8), value) -end - -function in9(value) - output("out"..((current_layer * 16) + 9), value) -end - -function in10(value) - output("out"..((current_layer * 16) + 10), value) -end - -function in11(value) - output("out"..((current_layer * 16) + 11), value) -end - -function in12(value) - output("out"..((current_layer * 16) + 12), value) -end - -function in13(value) - output("out"..((current_layer * 16) + 13), value) -end - -function in14(value) - output("out"..((current_layer * 16) + 14), value) -end - -function in15(value) - output("out"..((current_layer * 16) + 15), value) -end +function handler(value) + if(input_channel() == "control") then + -- Set the current_layer based on the control input channel + current_layer = math.floor(value * 31.99); + else + -- Handler functions for the input channels + -- Calculate the channel offset and just output the value the input channel provides + output("out"..((current_layer * 16) + tonumber(input_channel())), value) + print("Output on out"..(current_layer * 16)) + end +end \ No newline at end of file -- cgit v1.2.3 From 5f2808188b71c6eea7440c70321ccfe7b3ccdd55 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 26 Apr 2020 02:31:59 +0200 Subject: Fix channel name for layering config --- configs/layering.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configs') diff --git a/configs/layering.cfg b/configs/layering.cfg index b71f9e5..f312a65 100644 --- a/configs/layering.cfg +++ b/configs/layering.cfg @@ -7,7 +7,7 @@ bind = 0.0.0.0 [midi in] -read = BCF +read = Launch Control [artnet out] destination = 255.255.255.255 @@ -18,7 +18,7 @@ script = layering.lua default-handler = handler [map] -in.ch1.cc{1..8} > layers.in{0..7} +in.ch1.cc{0..15} > layers.{0..15} layers.out{0..511} > out.{1..512} in.ch0.note0 > layers.control -- cgit v1.2.3