-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsong.c
73 lines (67 loc) · 4.15 KB
/
song.c
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
#include <stdint.h>
struct ChipSong {
uint16_t songlen; // number of steps in the track sequencer
uint8_t numchannels; // 4 or 8 channels supported by now
uint8_t tracklength; // number of notes you can fit in each track. default is 32
uint8_t *tracklist; // id of tracks. songlen * numchannels
int8_t *transpose; // number of semitones. songlen * numchannels
uint16_t **instruments; // pointer to an array of pointers to command<<8 | parameter
uint32_t **tracks; // array of pointer to u32 elements
};
struct ChipSong polar_chipsong = {
// Song
.songlen=15,
.numchannels=4,
.tracklength=32,
.tracklist=(uint8_t[]) {
1,3,0,0,
1,3,0,0,
1,3,0,0,
1,3,0,0,
1,3,4,0,
1,3,4,0,
1,3,5,0,
1,3,5,0,
1,3,5,0,
1,3,5,0,
1,3,4,6,
1,3,4,6,
1,3,4,6,
1,3,5,6,
1,3,4,0,
},
.transpose=(int8_t[]){
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,
0,3,3,3,
0,5,5,5,
0,0,1,1,
0,0,0,0,
},
// Instruments
.instruments = (uint16_t* []){
(uint16_t[]){ 0x0a03, 0x03f4, 0x0950, 0x0100 },
(uint16_t[]){ 0x0c19, 0x0a02, 0x0940, 0x03fc, 0x0640, 0x0100 },
(uint16_t[]){ 0x0c31, 0x0400, 0x0a01, 0x0950, 0x03f5, 0x0270, 0x0100 },
(uint16_t[]){ 0x0a02, 0x0990, 0x0c25, 0x03fe, 0x0820, 0x03f4, 0x0100 },
(uint16_t[]){ 0x0a02, 0x021f, 0x0990, 0x0c25, 0x06d0, 0x0820, 0x03f4, 0x0100 },
},
// Tracks
.tracks = (uint32_t *[]) {
(uint32_t[]){ 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x3d0d0001, 0x00000000, 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0001, 0x00000000, 0x3d0d0001, 0x3d0d0001, }, // Track 1 - '00' / len: 32
(uint32_t[]){ 0x3d0d0002, 0x00000000, 0x00000000, 0x00000000, 0x3d0d0002, 0x00000000, 0x410d0002, 0x00000000, 0x420d0002, 0x00000000, 0x00000000, 0x420d0002, 0x00000000, 0x00000000, 0x410d0002, 0x00000000, 0x420d0002, 0x00000000, 0x00000000, 0x00000000, 0x450d0002, 0x00000000, 0x450d0002, 0x00000000, 0x470d0002, 0x00000000, 0x4b0d0002, 0x00000000, 0x4a0d0002, 0x00000000, 0x430d0002, }, // Track 2 - '01' / len: 31
(uint32_t[]){ 0x250d0003, 0x00000000, 0x00000000, 0x00000000, 0x250d0003, 0x00000000, 0x00000000, 0x00000000, 0x2c0d0003, 0x00000000, 0x00000000, 0x00000000, 0x2c0d0003, 0x00000000, 0x00000000, 0x00000000, 0x2f0d0003, 0x00000000, 0x00000000, 0x00000000, 0x2f0d0003, 0x00000000, 0x00000000, 0x00000000, 0x2f0d0003, 0x00000000, 0x00000000, 0x00000000, 0x260d0003, 0x00000000, 0x00000000, 0x2f0d0003, }, // Track 3 - '02' / len: 32
(uint32_t[]){ 0x250d0004, 0x00000000, 0x00000000, 0x00000000, 0x2c0d0004, 0x00000000, 0x00000000, 0x00000000, 0x2c0d0004, 0x00000000, 0x00000000, 0x00000000, 0x2a0d0004, 0x00000000, 0x2a0d0004, 0x00000000, 0x2f0d0004, 0x00000000, 0x00000000, 0x00000000, 0x2f0d0004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x2a0d0004, 0x00000000, 0x250d0004, 0x00000000, 0x2f0d0004, }, // Track 4 - '03' / len: 31
(uint32_t[]){ 0x260d0004, 0x00000000, 0x00000000, 0x00000000, 0x260d0004, 0x00000000, 0x00000000, 0x00000000, 0x260d0004, 0x00000000, 0x00000000, 0x00000000, 0x2d0d0004, 0x00000000, 0x2c0d0004, 0x00000000, 0x2c0d0004, 0x00000000, 0x00000000, 0x00000000, 0x2f0d0004, 0x00000000, 0x00000000, 0x00000000, 0x2d0d0004, 0x00000000, 0x2a0d0004, 0x00000000, 0x250d0004, 0x00000000, 0x2f0d0004, }, // Track 5 - '04' / len: 31
(uint32_t[]){ 0x250d0005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x2a0d0005, 0x00000000, 0x00000000, 0x00000000, 0x290d0005, 0x00000000, 0x00000000, 0x00000000, 0x250d0005, 0x00000000, 0x00000000, 0x00000000, 0x290d0005, 0x00000000, 0x00000000, 0x00000000, 0x250d0005, 0x00000000, 0x00000000, 0x00000000, 0x2c0d0005, }, // Track 6 - '05' / len: 29
}
};