forked from ryan-hodgman1/meadowphysics
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmxsynths.lua
More file actions
70 lines (54 loc) · 1.12 KB
/
Copy pathmxsynths.lua
File metadata and controls
70 lines (54 loc) · 1.12 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
--
-- m e a d o w p h y s i c s
--
-- a grid-enabled
-- rhizomatic
-- cascading counter
--
--
-- *----
-- *-----
-- *---
-- *-----
--
--
local meadowphysics = include("lib/mp/core")()
g = grid.connect()
engine.name="MxSynths"
local mxsynths_=include("mx.synths/lib/mx.synths")
local notelength = 3
-- voicing
function trigger(note_num, hz, voice)
engine.mx_note_on(note_num,1,notelength)
end
function gate_high(note_num, hz, voice)
engine.mx_note_on(note_num,1,notelength)
end
function gate_low(note_num, hz, voice)
engine.mx_note_off(note_num)
end
-- core stuff
function init()
meadowphysics.init()
mxsynths=mxsynths_:new()
params:add_separator()
cs_AMP = controlspec.new(0,60,'lin',0,0.1,'')
params:add{
type="control",id="note length",controlspec=cs_AMP,
action=function(x) notelength = x end
}
end
function key(n,z)
meadowphysics:handle_key(n,z)
end
function g.key(x, y, z)
meadowphysics:handle_grid_input(x, y, z)
end
function redraw()
screen.clear()
meadowphysics:draw()
screen.update()
end
function cleanup()
meadowphysics:all_notes_off()
end