aboutsummaryrefslogtreecommitdiffhomepage
path: root/configs/returnone.lua
blob: 5296de0bdeb4afea93ab4ab44bcebebd6cc9c914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- ReturnOne by Paul Hedderly
-- Sometimes you just want an on/off from linear pads
-- For example I want to activate scenes in OBS from a Korg NanoPad2
-- But I don't 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 returnone(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