Skip to content

Commit 58bdce5

Browse files
author
Paul Hedderly
committed
prh: new example return just one - like bool, but just one
1 parent f0ea4b8 commit 58bdce5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

configs/returnjustone.lua

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- ReturnOne by Paul Hedderly
2+
-- Sometimes you just want just an on - and from any imput but 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 returnjustone(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+
end

0 commit comments

Comments
 (0)