-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsequencer_ESS_0.eel
64 lines (58 loc) · 1.37 KB
/
sequencer_ESS_0.eel
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
////////////////////////////////////////////////////////////////////////
// sequencer_ESS_0.eel - Header for loading ESS 0 format EELSynth songs
// Copyright (C) 2010 David Olofson
////////////////////////////////////////////////////////////////////////
import "sequencer" as seq;
export procedure Process(sequencer)
{
local track = sequencer.tracks[0];
procedure Generator(s)
{
print("Generator: ", s, "\n");
}
procedure Format(f, v)
{
print("Format: ", f, ", version ", (string)v, "\n");
if f != "ESS"
print("WARNING: This is not an EES file!\n");
if v != 0
print("WARNING: File format version is not 0!\n");
}
procedure Tempo(t)
{
upvalue sequencer.tempo = t;
}
procedure TimeSig(b, m)
{
upvalue sequencer.(beat, measure) = b, m;
}
procedure Loop(s, l)
{
upvalue sequencer.(start, loop) = s, l;
}
procedure Track(t)
{
upvalue track = upvalue sequencer.tracks[t];
}
procedure IC<p, v>
{
for local i = 0, tuples - 1
upvalue track.icontrols[p[i]] = v[i];
}
procedure C(t, vv, p, v)
{
upvalue track:Insert([t, seq.EV_CONTROL, vv, p, v]);
}
procedure D(t, vv)
{
upvalue track:Insert([t, seq.EV_DETACH, vv]);
}
procedure I(t, i, p)
{
upvalue track:Insert([t, seq.EV_INSTRUMENT, i, p]);
}
procedure CC(t, p, v)
{
upvalue track:Insert([t, seq.EV_CCONTROL, p, v]);
}
// Append ESS 0 serialized song here, and then a "}" after that!