-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmml.rb
96 lines (89 loc) · 5.57 KB
/
mml.rb
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
89
90
91
92
93
94
95
96
# Before running this file, first run helpers/mml.rb to load the mml function
use_debug false
use_synth :pulse
use_synth_defaults release: 0.3, mod_rate: 5, amp: 0.6
define :tetris do
in_thread do
use_synth :chiplead
mml('t150>e4<b8>c8d8e16d16c8<b8a4a8>c8e4d8c8<b4.>c8d4e4c4<a4a2r8>d4f8a4g8f8e4.c8e4d8c8<b4b8>c8d4e4c4<a4a4r4.')
end
with_fx :level, amp: 0.5 do
use_synth :chipbass
mml('t150o2e8>e8<e8>e8<e8>e8<e8>e8<a8>a8<a8>a8<a8>a8<a8>a8<g+8>g+8<g+8>g+8<e8>e8<e8>e8<a8>a8<a8'+
'>a8<a8>a8<b8>c8d8<d8r8d8r8d8a8f8c8>c8r8c8<c8g8g8r8b8>b8r8b8r8e8r8g+8<a8>e8<a8>e8<a4r4')
end
end
define :tetris2 do
in_thread do
use_synth :chiplead
mml('V127t150>e4<b8>c8d8e16d16c8<b8a4a8>c8e4d8c8<b4.>c8d4e4c4<a4a2&a8>d4f8a4g8f8e4.c8e4d8c8<b4'+
'b8>c8d4e4c4<a4a2>e4<b8>c8d8e16d16c8<b8a4a8>c8e4d8c8<b4.>c8d4e4c4<a4a2&a8>d4f8a4g8f8e4.c8e4'+
'd8c8<b4b8>c8d4e4c4<a4a2e2c2d2<b2>c2<a2g+2b2>e2c2d2<b2>c4e4a2g+1>e4<b8>c8d8e16d16c8<b8a4a8>'+
'c8e4d8c8<b4.>c8d4e4c4<a4a2&a8>d4f8a4g8f8e4.c8e4d8c8<b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8e8c16e8g2c8.<g8.e8.a8b8a+16a8g16.>e16g16.a8f16g8e8c16d16<b8.>c8.<g8.e8.a8b8a+16a8g16.'+
'>e16g16.a8f16g8e8c16d16<b4&b16>g16f+16f16d+8e8<g+16a16>c8<a16>c16d8.g16f+16f16d+8e8>c8c16c4.<g16'+
'f+16f16d+8e8<g+16a16>c8<a16>c16d8.d+8.d8.c2&c8g16f+16f16d+8e8<g+16a16>c8<a16>c16d8.g16f+16f16d+8'+
'e8>c8c16c4.<g16f+16f16d+8e8<g+16a16>c8<a16>c16d8.d+8.d8.c2c16c8c8c16d8e16c8<a16g4>c16c8c8c16d16'+
'e2&e16c16c8c8c16d8e16c8<a16g4>e16e8e8c16e8g2c8.<g8.e8.a8b8a+16a8g16.>e16g16.a8f16g8e8c16d16<b8.>'+
'c8.<g8.e8.a8b8a+16a8g16.>e16g16.a8f16g8e8c16d16<b8.>e16c8<g8.g+8a16>f8f16<a4b16.>a16a16.a16.g16'+
'f16.e16c8<a16g4>e16c8<g8.g+8a16>f8f16<a4b16>f8f16f16.e16d16.c2e16c8<g8.g+8a16>f8f16<a4b16.>a16a16.'+
'a16.g16f16.e16c8<a16g4>e16c8<g8.g+8a16>f8f16<a4b16>f8f16f16.e16d16.c2c16c8c8c16d8e16c8<a16g4>c16'+
'c8c8c16d16e2&e16c16c8c8c16d8e16c8<a16g4>e16e8e8c16e8g2e16c8<g8.g+8a16>f8f16<a4b16.>a16a16.a16.g16'+
'f16.e16c8<a16g4>e16c8<g8.g+8a16>f8f16<a4b16>f8f16f16.e16d16.c3')
end
define :cantina do
in_thread do
mml('v120t250a4>d4<a4>d4<a8>d4<a4g+8a4a8g+8a8g4f+8g8f+8f2d2a4>d4<a4>d4<a8>d4<a4g+8a4g4g4.f+8g4>'+
'c8<a+4a4g4.a4>d4<a4>d4<a8>d4<a4g+8a4>c4c4.<a8g4f4.d2&d8d2f2a2>c2d+4d4<g+8a4f1&f4a4f8a2&a8a4'+
'f8a2&a8a4f8g+8a4.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