Skip to content

Commit f0ea4b8

Browse files
author
Paul Hedderly
committed
prh: new example config bool - turn pads into 0/1 output
1 parent 838486b commit f0ea4b8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

configs/returnbool.lua

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-- ReturnOne by Paul Hedderly
2+
-- Sometimes you just want an on or off - and it might be from anything >0
3+
-- For example I want to activate scenes in OBS from a Korg NanoPad2
4+
-- But I dont want to have to thump the pads to get a 1.0 output
5+
--
6+
-- You could use this as:
7+
-- [midi nanoP]
8+
-- read = nanoPAD2
9+
-- write = nanoPAD2
10+
-- [lua trackpad]
11+
-- script = trackpad.lua
12+
-- default-handler = returnone
13+
-- ..
14+
-- nanoP.ch0.note{36..51} > returnone.one{1..16} -- To feed all the 16 pads to
15+
-- returnone.outone1 > obs./obs/scene/1/preview
16+
-- returnone.outone2 > obs./obs/scene/2/preview
17+
-- etc
18+
-- The output channel will be the same as the channel you feed prepended "out"
19+
20+
21+
function returnbool(v) -- Use a default function - then you can use any input channel name
22+
if v>0 then output("out"..input_channel(),1) end;
23+
if v==0 then output("out"..input_channel(),0) end;
24+
end

0 commit comments

Comments
 (0)