/
1_square.lua
58 lines (48 loc) · 1.16 KB
/
1_square.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- scriptname: 1_square
-- v1.1.0 @jah
engine.name = 'R'
local R = require 'r/lib/r'
local Formatters = require 'formatters'
function init()
engine.new("Osc", "PulseOsc")
engine.new("SoundOut", "SoundOut")
engine.connect("Osc/Out", "SoundOut*Left")
engine.connect("Osc/Out", "SoundOut*Right")
params:add {
type="control",
id="osc_range",
name="Osc.Range",
controlspec=R.specs.PulseOsc.Range,
action=function(value) engine.set("Osc.Range", value) end
}
params:add {
type="control",
id="osc_tune",
name="Osc.Tune",
controlspec=R.specs.PulseOsc.Tune,
action=function(value) engine.set("Osc.Tune", value) end
}
params:add {
type="control",
id="osc_pulsewidth",
name="Osc.PulseWidth",
controlspec=R.specs.PulseOsc.PulseWidth,
formatter=Formatters.percentage,
action=function(value) engine.set("Osc.PulseWidth", value) end
}
params:bang()
end
function redraw()
screen.clear()
screen.level(15)
screen.move(1, 10)
screen.text("SQUARE")
screen.move(1, 30)
screen.text("See params in menu")
screen.update()
end
function enc(n, delta)
if n == 1 then
mix:delta("output", delta)
end
end