play skript
This commit is contained in:
parent
3734dee889
commit
630e50a716
|
@ -0,0 +1,30 @@
|
|||
|
||||
local sv = require "sunvoxlua"
|
||||
|
||||
sv.open_slot(0);
|
||||
sv.load(0, "test.sunvox")
|
||||
|
||||
-- subformat od https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm
|
||||
function play(str)
|
||||
local note2num = {
|
||||
C = 60,
|
||||
D = 62,
|
||||
E = 64,
|
||||
F = 65,
|
||||
G = 67,
|
||||
A = 69,
|
||||
B = 71
|
||||
}
|
||||
|
||||
|
||||
str = string.upper(str)
|
||||
for i=1,string.len(str) do
|
||||
if note2num[string.sub(str, i, i)] then
|
||||
sv.send_event(0, 0, note2num[string.sub(str, i, i)], 0, 2, 0, 0)
|
||||
sv.sleep(1000)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
play "CDEFGAB"
|
Loading…
Reference in New Issue