-
-
Save ryland/1b0f9739d4ac5729ab4ccf9ed6f652a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Panning Test | |
-- | |
-- --------------------- | |
-- | |
-- | |
engine.name = "SoftCut" | |
l = 0.5 | |
r = 0.5 | |
function init() | |
engine.loop_start(1,1) | |
engine.loop_end(1,5) | |
engine.pos(1,1) | |
engine.loop_on(1,1) | |
engine.pre(1,1) | |
engine.amp(1,1) | |
engine.rec_on(1,1) | |
engine.rec(1,1) | |
engine.adc_rec(1,1,0.8) | |
engine.adc_rec(2,1,0.8) | |
engine.play_dac(1,1,l) | |
engine.play_dac(1,2,r) | |
engine.rate(1,1) | |
engine.reset(1) | |
engine.clear() | |
end | |
-- keys | |
function key(n,z) | |
if n == 2 and z == 1 then | |
l = 1.0 | |
r = 0.0 | |
elseif n == 3 and z == 1 then | |
l = 0.0 | |
r = 1.0 | |
end | |
engine.play_dac(1, 1, l) | |
engine.play_dac(1, 2, r) | |
redraw() | |
end | |
-- encoders | |
function enc(n,d) | |
if n == 2 then | |
l = util.clamp(l + d/100, 0.0,1.0) | |
elseif n == 3 then | |
r = util.clamp(r + d/100, 0.0,1.0) | |
end | |
engine.play_dac(1, 1, l) | |
engine.play_dac(1, 2, r) | |
redraw() | |
end | |
function redraw() | |
screen.clear() | |
screen.level(5) | |
screen.move(0,40) | |
screen.text("Pan Test") | |
screen.move(0,50) | |
screen.text("L: " .. l) | |
screen.move(0,60) | |
screen.text("R: " .. r) | |
screen.update() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment