Files
smnp-kt/examples/cantina.mus

125 lines
5.3 KiB
Plaintext

import smnp.io;
import smnp.collection;
import smnp.audio.midi;
println("Star Wars :: Cantina Band");
println("by John Williams");
cb1 = [@a, @d5, @a, @d5] + [@a:8, @d5, @a:8, 8, @g#:8, @a];
cb2 = [@a:8, @g#:8, @a:8, @g:8, 8, @f#:8, @g:8, @gb:8];
cb3 = [@f:4d, @d:2, 8];
cb4 = [@g:8, 8, @g:4d, @f#:8, @g];
cb5 = [@c5:8, @b, @a, @g:4d];
cb6 = [@c5:8, 8, @c5:4d, @a:8, @g];
cb7 = [@f:4d, @d:2, 8];
cb8 = [@d:2, @f:2, @a:2, @c5:2];
cb9 = [@eb5, @d5, @g#:8, @a, @f:8];
CB1 = cb1 + cb2 + cb3 + cb1 + cb4 + cb5 + cb1 + cb6 + cb7 + cb8 + cb9 + [1];
cb11 = 2 ^ [8, @a5, @f5:8, @a5:8, 8, 4];
cb12 = [8, @a5, @f5:8, @g#5:8, @a5, @f5:8];
cb13 = [@f5:4d, @d5:2, 8];
cb14 = [8, @a5, @f5:8, @g#5:8, @a5, @g5:8];
cb15 = [@g5:2, @c5:2];
cb16 = [@b:8, @d5:8, @f5, @h:8, @d5:8, @f5];
cb17 = [@g#:8, @a5, @d5:2, 8];
cb18 = [@d:8, @f:8, @h:8, @d5:8, @g#:8, @a, @f:8];
cb19 = [@f:2d, 4];
CB2 = cb11 + cb12 + cb13 + cb11 + cb14 + cb15 + cb11 + cb12 + cb13 + cb16 + cb17 + cb18 + cb19;
cb20 = [@f, 8, @ab, @f:8, @g];
cb21 = [8, @f:8, @ab:8, @f:8, @g:8, @f:8, @ab:8, @d:8];
cb22 = [@f, 8, @ab, @f:8, @g];
cb23 = [@f:8, @f:8, @ab:8, @f:8, @g:8, @f:8, @ab:8, @f:8];
cb24 = [@g:8, @f:8, @ab:8, @f:8, @g:8, @f:8, @ab:8, @d:8];
cb25 = [@f:8, @f:8, @ab:8, @f:8, @ab:8, @f, @f:8, @f:2d, 4];
CB3 = cb20 + cb21 + cb22 + cb21 + cb22 + cb21 + cb23 + cb24 + cb22 + cb21 + cb22 + cb21 + cb22 + cb21 + cb25;
cb26 = [@c5, 8, @e5:8, 4, @g5];
cb27 = [@g5:8, @g5, @g5:8, @g5, @e5:8, @c5:8];
cb28 = [@f5, @f5:8, @f5:8, @f5:8, @g5, @a5:8, @a5:1];
cb29 = [@e5, @e5, @g5:8, @g5, @c5:8];
cb30 = [@c5:8, @e5, @c5:8, @e5, @g5];
cb31 = [@f5, @f5:8, @f5, @g5, @a5:8, @a5:1];
cb32 = [@b5, @b5, @d6, @b5:8, @db6:8];
cb33 = [@db6:8, @db6:8, @b5, @db6, @b5];
cb34 = [@f5, @f5, @f5:8, @ab5, @d6:8, @d6:1];
cb35 = [8, @b, @d5:8, @g5, @g5];
cb36 = [8, @e5, 8, @e5, @e5];
cb37 = [8, @f5, @f5:8, @f5, @f5:8, @f5:8];
cb38 = [@f5:8, @f5, @f5:8, @f5:8, @f5:8, @f5];
CB4 = cb26 + cb27 + cb28 + cb29 + cb30 + cb31 + cb32 + cb33 + cb34 + cb35 + cb36 + cb37 + cb38;
cb39 = [@ab:8, @gb:8, @ab:8, @gb:8, @ab:8, @gb:8, @ab:8, @gb:8];
cb40 = [@ab:8, @db5, @ab:8, @db5, @ab:8, @db5:8];
cb41 = [8, @ab:8, @b:8, @h:8, @c5:8, @h:8, @b:8, 8];
cb42 = [@ab:8, @db5, @ab:8, @db5, @ab:8, @a:8];
cb43 = [@b:8, @a:8, @b:4d, @a:8, @b:8, @a:8];
cb44 = [@b:8, @a:8, @b:8, @h:8, @c5:8, 8, @gb:8, @g:8];
cb45 = [@b:8, @a:8, @b:4d, @a:8, @b:8, @h:8];
cb46 = [@c5:8, @g:8, @e:8, @c:8, 8, @c:8, @db:8, @c:8];
cb47 = [@db:8, @b3, @db:8, @fb:8, @db, @fb:8];
cb48 = [@f:8, @e:8, @f:8, @gb:8, @g:8, @c, @g:8];
cb49 = [@ab:8, @g:8, @ab:8, @a:8, @b:8, @a:8, @b:8, @h:8];
cb50 = [@c5:8, @c5:8, 4, @c5:8, @c5:8, 4];
cb51 = [@c5, @e5:2, @f5:8, @db5:8];
cb52 = [@ab:8, @f:8, @fb:8, @eb:8, @d:8, 4, @gb:8];
cb53 = [@c5:8, @c5, @gb:8, @c5:8, @c5, @h:8];
cb54 = [@c5:8, @c5, @h:8, @c5:8, @c5, @c5:8];
cb55 = [@db5:8, @fb:8, @db5:4d, @fb:8, @db5:8, @fb:8];
cb56 = [@db5:8, @fb:8, @db5:8, @fb:8, @eb:8, @c5, @c5:8];
cb57 = [@db5:8, @fb:8, @db5:8, @fb:8, @eb:8, @c5, @h3:8];
cb58 = [@b3:8, @db:8, @gb:8, @b:8, @c:8, @e:8, @g:8, @c5:8];
cb59 = [@db5:8, @db, @c:8, @db, 4];
cb60 = [4, @a3, @b3, @a3, @b3, @a3, @gb3:8, @f3:8, @d3:8, 8];
cb61 = [8, @a3, @a3, @a3, @a3, @a3, @a3:8, @a3:8, @a3];
CB5 = cb39 + cb40 + cb41 + cb39 + cb42 + cb43 + cb44 + cb39 + cb42 + cb45 + cb46 + cb47 + cb48 + cb49 + cb50 + cb50 + cb51 + cb52 + cb53 + cb54 + cb55 + cb56 + cb55 + cb56 + cb55 + cb57 + cb58 + cb59 + cb60 + cb60 + cb60;
CB = CB1 + CB2 + CB3 + (2 ^ CB4) + CB5;
b1 = (3 ^ [@d3, 4, @a2, 4]) + [@f3, 4, @c3, 4, @d3, 4, @a2, 4, @d3, 4, @a2, 4, @g2, 4, @g2, 4];
b2 = [@c3, @d3, @d#3, @e3, @d3, 4, @a2, 4, @d3, 4, @a2, 4, @c3, 4, @c3, 4];
b3 = [@f3, 4, @c3, 4, @b2, 4, @b2, 4, @f3, 4, @d3, 4, @g3, 4, @c3, 4, @f3, @e3, @d3, @c3];
B1 = b1 + b2 + b3;
b4 = (3 ^ [@d3, 4, @a2, 4]) + [@d3:4d, @g#2:4d, @a2];
b5 = (3 ^ [@d3, 4, @a2, 4]) + [@eb3:2, @c3, @c3];
b6 = (4 ^ [@d3, 4, @a2, 4]);
b7 = [@b2:8, @b2:8, 4, @h2:8, @h2:8, 4, @c3:4d, @d3:8, 8, @d3:8, @d3, @g2, 4, @c3:4d, @f3:4d, @e3, @d3, @c3];
B2 = b4 + b5 + b6 + b7;
b8 = 3 ^ [@d3, @c3, @b2, @a2, @g2, @f2, @e2, @d2];
b9 = [@d3, 4, 2, 2, 4, @a2];
b10 = [@d3, @b2, @a2, @a2, @d3:8, 8, 4, 2];
B3 = b8 + b9 + b8 + b10;
b11 = [@c3, 4, @g2, 4, @c3, 8, @b2:4d, @g2, @f2, 4, @c3, 4, @f3, 8, @e3:4d, @d3];
b12 = [@c3, 4, @g3, 4, @c3, 8, @b2:4d, @g2, @f2, 4, @c3, 4, @d3, 8, @f#2:4d, @a2];
b13 = [@b2, 4, @b2, 4, @h2, 4, @h2, 4, @c3, 4, @c3, 4, @d3, 8, @d3:4d, @f#2];
b14 = [@g2, 4, @d3, 4, @c3, 8, @c3:4d, @g3, @f3, 4, @db3, 4, @f3, @f3, @e3, @d3];
B4 = b11 + b12 + b13 + b14;
b15 = [@db3, @c3, @b2, @ab2, @gb2, @f2, @eb2, @db2, @db3, @b2, @a2, @ab2];
b16 = [@db3, @c3, @b2, @ab2, @gb2, @f2, @eb2, @db2, @eb2, @e2, @f2, @gb2];
b17 = [@e2, @d2, @h2, @ab2, @h2, @ab2, @f2, @eb2, @db2, @c2, @b1, @ab1];
# ^ or B?
b18 = [@gb2, @gb2, @gb2, @db3, @c3, @c3, @e3, @g3, @gb3, @gb3, @g3, @g3];
b19 = [@ab3, @db3, @c3, @c3, @f3, @c3, @gb3, @gb3, @c3, 4, @c3, 4];
b20 = [@f3, 4, @f3, 4, @c3, @c3, 4, @db3:8, @f3:8, @ab3:8, @a3:8, @b3:8, @h3:8, @c:8, 8, 8, 16, @g3:16];
b21 = [@c3, 4, @c3, 4, @f3, 4, @f3, 4, @gb2, 4, @ab2, 4, @a2, 4, @db3, 4, @gb2, 4, @ab2, 4, @a2, 4, @db3, 4, @d, 4, @eb, 4];
b22 = [@e3, 4, @f3, 4, @gb3, 4, @g3, 4, @db3, 4, @db3, 4];
B5 = b15 + b16 + b17 + b18 + b19 + b20 + b21 + b22;
B = B1 + B2 + B3 + (2 ^ B4) + B5;
midi({ bpm -> 270 }, [instrument(9)] + CB.flatten(), [instrument(34)] + B.flatten());