-
Notifications
You must be signed in to change notification settings - Fork 4
/
default.lua
89 lines (69 loc) · 1.9 KB
/
default.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
info.setText("by www.xot.nl")
function defaultFormatter(valueObject, value)
return("")
end
function formatSmallFloat (valueObject, value)
return (string.format("%.3f",value/1000))
end
function formatFloat (valueObject, value)
return (string.format("%.2f",value/100))
end
function formatLargeFloat (valueObject, value)
return (string.format("%.1f",value/10))
end
function formatdB (valueObject, value)
return (string.format("%.1f dB",value/10))
end
function formatFreq (valueObject, value)
return (string.format("%.1f Hz",value/10))
end
function formatPan (valueObject, value)
if value < 0 then
return (string.format("%iL", -value))
elseif value == 0 then
return "C"
else
return (string.format("%iR", value))
end
end
function formatPercent (valueObject, value)
return (string.format("%.1f %%",value/10))
end
function fmtSemiIntPercent (valueObject, value)
if (-100 < value) and (value < 100) then
return (string.format("%.1f %%",value/10))
else
return (string.format("%.0f %%",value/10))
end
end
function formatIntPercent (valueObject, value)
return (string.format("%.0f %%",value/10))
end
function formatDegree (valueObject, value)
return (string.format("%i *",value))
end
function formatSemitone (valueObject, value)
return (string.format("%i st",value))
end
function formatFineSemitone (valueObject, value)
return (string.format("%.2f st",value/100))
end
function formatDetune (valueObject, value)
return (string.format("%i ct",value))
end
-- start/stop display drawing
function aa()
window.stop()
end
function zz()
window.resume()
end
-- handling patch requests to switch between mixer/effect
function patch.onRequest (device)
print ("Patch Request pressed",device.id);
if device.id == 1
then print ("Sending patch request MIDI");
midi.sendSysex(PORT_1, {0x00, 0x21, 0x45, 0x7E, 0x7E}) ;
print ("Sent patch request MIDI");
end
end