-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.lua
More file actions
71 lines (62 loc) · 1.6 KB
/
Copy pathtest.lua
File metadata and controls
71 lines (62 loc) · 1.6 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
-- arcify
-- test script
--
-- go to the PARAMS page to assign
-- params to your Arc
engine.name = "TestSine"
-- create Arcify class and arcify object
local Arcify = include("lib/arcify")
local arcify = Arcify.new()
function init()
-- add some params for arcify to tap into
params:add {
type = "control",
id = "hz",
name = "Frequency",
controlspec = controlspec.new(100, 8000, "exp", 10, 220),
action = function(value)
engine.hz(value)
redraw()
end
}
params:add {
type = "control",
id = "amp",
name = "Amplitude",
controlspec = controlspec.new(0, 1, "lin", 0.01, 0.5),
action = function(value)
engine.amp(value)
redraw()
end
}
-- register parameters with arcify
arcify:register("hz", 10)
arcify:register("amp", 0.01)
-- after registering all your params run add_params()
-- to make them visible in norns params menu
arcify:add_params()
end
function key(n, z)
-- if you want to use a shift key with Arcify
-- pass key params in
arcify:handle_shift(n, z)
redraw()
end
function redraw()
screen.clear()
screen.move(16, 16)
screen.text("Arcify Test")
screen.move(16, 28)
screen.text("Hz")
screen.move(36, 28)
screen.text(params:get("hz"))
screen.move(16, 36)
screen.text("Amp")
screen.move(36, 36)
screen.text(params:get("amp"))
screen.move(16, 48)
screen.text("See the PARAMS screen")
screen.move(16, 56)
screen.text("to assign Arc encoders")
screen.update()
end