aboutsummaryrefslogtreecommitdiffhomepage
path: root/configs/returnbool.lua
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-07-28 14:01:28 +0200
committerGitHub <noreply@github.com>2021-07-28 14:01:28 +0200
commit96b727c43595ab80ac2eb370f25e197987e88f55 (patch)
tree162aaa19c7ad9db9bc593506daa6f2bbbb9e11a9 /configs/returnbool.lua
parent22111533d32a30dd52d51a7264c67f8afc7a6bd7 (diff)
parent4359b0cc0793ce76c3e7917a951052ea17aba355 (diff)
downloadmidimonster-96b727c43595ab80ac2eb370f25e197987e88f55.tar.gz
midimonster-96b727c43595ab80ac2eb370f25e197987e88f55.tar.bz2
midimonster-96b727c43595ab80ac2eb370f25e197987e88f55.zip
Merge pull request #94 from phedders/prh-examples
Merge lua examples from phedders
Diffstat (limited to 'configs/returnbool.lua')
-rw-r--r--configs/returnbool.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/configs/returnbool.lua b/configs/returnbool.lua
new file mode 100644
index 0000000..50266d9
--- /dev/null
+++ b/configs/returnbool.lua
@@ -0,0 +1,24 @@
+-- ReturnOne by Paul Hedderly
+-- Sometimes you just want an on or off - and it might be from anything >0
+-- For example I want to activate scenes in OBS from a Korg NanoPad2
+-- But I dont want to have to thump the pads to get a 1.0 output
+--
+-- You could use this as:
+-- [midi nanoP]
+-- read = nanoPAD2
+-- write = nanoPAD2
+-- [lua trackpad]
+-- script = trackpad.lua
+-- default-handler = returnone
+-- ..
+-- nanoP.ch0.note{36..51} > returnone.one{1..16} -- To feed all the 16 pads to
+-- returnone.outone1 > obs./obs/scene/1/preview
+-- returnone.outone2 > obs./obs/scene/2/preview
+-- etc
+-- The output channel will be the same as the channel you feed prepended "out"
+
+
+function returnbool(v) -- Use a default function - then you can use any input channel name
+ if v>0 then output("out"..input_channel(),1) end;
+ if v==0 then output("out"..input_channel(),0) end;
+end