-
Notifications
You must be signed in to change notification settings - Fork 0
/
riff.h
executable file
·254 lines (222 loc) · 8.07 KB
/
riff.h
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#ifndef RIFF_H
#define RIFF_H
//utility riffs
extern unsigned char code sthRest[5];
extern unsigned char code eiRest[5];
extern unsigned char code qRest[5];
extern unsigned char code hRest[5];
extern unsigned char code wRest[5];
//single Piteches plus switches
#define MINORDRONE_ROOT 29
#define WHOLEDRONE_ROOT 30
extern unsigned char code wholeDrone[5];
extern unsigned char code minorDrone[5];
//COORD UTIL
#define RECO_S (2+1)
extern unsigned char code sthRestCoord[RECO_S];
extern unsigned char code eiRestCoord[RECO_S];
extern unsigned char code qRestCoord[RECO_S];
extern unsigned char code hRestCoord[RECO_S];
extern unsigned char code wRestCoord[RECO_S]; //one empty bar
extern unsigned char code wDblRestCoord[RECO_S]; //two empty bars
#define CRTLTX_S (4+1)
extern unsigned char code on0Tx[CRTLTX_S];
extern unsigned char code on2Tx[CRTLTX_S];
extern unsigned char code on4Tx[CRTLTX_S];
extern unsigned char code on6Tx[CRTLTX_S];
extern unsigned char code on8Tx[CRTLTX_S];
extern unsigned char code on10Tx[CRTLTX_S];
extern unsigned char code on12Tx[CRTLTX_S];
extern unsigned char code on14Tx[CRTLTX_S];
extern unsigned char code off0Tx[CRTLTX_S];
extern unsigned char code off2Tx[CRTLTX_S];
extern unsigned char code off4Tx[CRTLTX_S];
extern unsigned char code off6Tx[CRTLTX_S];
extern unsigned char code off8Tx[CRTLTX_S];
extern unsigned char code off10Tx[CRTLTX_S];
extern unsigned char code off12Tx[CRTLTX_S];
extern unsigned char code off14Tx[CRTLTX_S];
//special riffs
///////////COORD SONG////////////////
/*
Spec for COORD song
word songLen, byte???,
word riffAddy, byte repeats...
*/
/*
spec for COORD riff
byte deltaPos, byte MIDI / CC+Ch, byte val
o
MIDI / Sys or RT,
o
tempo [hiNibble] val [loNibble], 2 bytes
[e.g. 0x7F, 0xF3, 0xFF -> cnt0 = 0f, periodH0 = f3, periodL0 = ff
ideal 77160 [0x12D68] is 120 bpm <- theres a mystery factor of two, but thats a godd thing!!!!
explicitly TimerPeriod = QuaterNotePeriod [us] / 24 / 0.271 [us]
Tempo and future file meta events...
we reserve the high nibble for meta events
and the low nibble for data...
Meta events are sparse and easily mapped and
even extended to 8 states... (high bit is for real midi)
*/
/////////////WORKER SONG//////////////////
/*
Spec for song:
word songLen, byte ???,
(word) riffAddress, byte repeats, (riff_t)
(word) riffAddress, byte repeats,
...
*/
/*
Spec for riff:
byte riffLen,
byte deltaSongPos, byte 0-126 Notes [ 127 = NoteOff, 0x80 = V_Chan ]
byte deltaSongPos, byte 0-126 Notes [ 127 = NoteOff, 0x80 = V_Chan ]
...
*/
//#define BEAT_ROOT (48)
//#define BEAT1_TEMPO (0x6f00/2) //240
//#define BEAT2_TEMPO (0x6f00/4) //240
//#define BEATCOORD1_S (69)
//#define BEAT1_S 3
//extern unsigned char code beatCoord1[BEATCOORD1_S];
//extern unsigned char code beatCoord2[BEATCOORD1_S];
//extern unsigned char code beat1[BEAT1_S];
//shepStat
#define SHEP_TEMPO (0x12D68*2) //60BPM
#define SHEP_FASTER_TEMPO (0x6666) //real fast
#define SHEP_FAST_TEMPO (0x2666) //real fast
extern unsigned char code shepStatCoordInit[5];
extern unsigned char code shepStatCoordFastInit[5];
extern unsigned char code shepStatCoordFasterInit[5];
extern unsigned char code shepStatCoord[33];
extern unsigned char code shepStat[9];
//shepStatVoiced
extern unsigned char code shepStatVoiced[17];
//peace
#define PEACE_TEMPO (0x800d) // >160?
#define PEACEONE_S (7)
extern unsigned char code peaceCoord[5];
extern unsigned char code peaceOne[PEACEONE_S];
extern unsigned char code peaceTwo[PEACEONE_S];
extern unsigned char code peaceThree[PEACEONE_S];
extern unsigned char code peaceAs4[PEACEONE_S];
extern unsigned char code peaceGs4[PEACEONE_S];
//BODY
#define BODY_TEMPO (0x12D68*2) //60 BPM
extern unsigned char code bodyInit[5]; //uses whole and minor drone
//BUSY
#define BUSY_TEMPO (0x6f00)
#define BUSY_TEMPO1 (0x7f00)
#define BUSY_TEMPO2 (0x8f00)
#define BUSY_TEMPO3 (0x9f00)
#define BUSY_TEMPO4 (0xaf00)
#define BUSY1_SIZE (13)
#define BUSY2STAT_SIZE (29)
extern unsigned char code busyInit[5];
extern unsigned char code busySlower1[5];
extern unsigned char code busySlower2[5];
extern unsigned char code busySlower3[5];
extern unsigned char code busySlower4[5];
extern unsigned char code busy1[BUSY1_SIZE];
extern unsigned char code busy2[BUSY1_SIZE-2];
extern unsigned char code busy2Stat[BUSY2STAT_SIZE];
//onStat
#define ONSTAT_TEMPO (0xEDED) //??
#define ONSTAT1_S (28+1)
#define ONSTAT2_S (60+1)
#define ONSTAT3_S (28+1)
#define ONSTAT4_S (28+1)
#define ONSTATMEL1_S (24+1)
#define ONSTATMEL2_S (16+1)
extern unsigned char code OnStatCoordInit[5];
extern unsigned char code OnStat1[ONSTAT1_S];
extern unsigned char code OnStat2[ONSTAT2_S];
extern unsigned char code OnStat3[ONSTAT3_S];
extern unsigned char code OnStat4[ONSTAT4_S];
extern unsigned char code OnStatMel1[ONSTATMEL1_S];
extern unsigned char code OnStatMel2[ONSTATMEL2_S];
//HAPPY
#define HAPPY1_S (177)
#define HAPPY3_S (15)
#define HAPPY_TEMPO (0xe20f) //160
extern unsigned char code happyCoordInit[5]; //then whole rests..
extern unsigned char code happy1[HAPPY1_S];
extern unsigned char code happy2[HAPPY1_S];
extern unsigned char code happy3[HAPPY3_S];
extern unsigned char code happyDrone[3];
extern unsigned char code happyDroneTx[3];
extern unsigned char code happyDroneTx2[3];
//extern unsigned char code happy1Tx[HAPPY1_S];
//extern unsigned char code happy2Tx[HAPPY1_S];
//extern unsigned char code happy3[HAPPY1_S];
//extern unsigned char code happy4[HAPPY1_S];
//Driving me back...
#define DMB_ROOT (25) //C# - yeah we in tune!
#define DMB_PEDAL (DMB_ROOT-1)
#define DMB_TEMPO (0x20B61) //~69-70 BPM 0x20B61
#define DMBINIT_S 37
extern unsigned char code dmbInit[37];//tempo ... does pickup!!!
#define DMBVAMP_S (4+1)
extern unsigned char code dmbVamp0[DMBVAMP_S]; //sans downbeat
extern unsigned char code dmbVamp1[DMBVAMP_S]; //cum downbeat
#define DMBROOT_S ((104-72)*4+1)
extern unsigned char code dmbRoot0[DMBROOT_S]; //sans downbeat
extern unsigned char code dmbRoot1[DMBROOT_S];
#define DMBBD_S 7
extern unsigned char code dmbBDHa[DMBBD_S];
extern unsigned char code dmbBDWh[DMBBD_S];
#define VEX_S ( 20*2 + 1 )
#define VEX_SHIFT (-24) //Pitch shift
#define VEX_TEMPO (0xf0000) //goood...
extern unsigned char code vexInit[5];
extern unsigned char code vex1[VEX_S];
extern unsigned char code vex2[VEX_S];
extern unsigned char code vex3[VEX_S];
extern unsigned char code vex3vb[VEX_S];
//TAPISSERIE EN FER FORGE ~60 BPM... 6/8 tres riche
#define TEFF_TEMPO (0x12D68*2)
#define TEFF1_S (29)
#define TEFF3_S (33)
#define TEFF4_S (43)
#define TEFF5_S (47)
extern unsigned char code TeFFInitCoord[5];
extern unsigned char code TeFF1[TEFF1_S];
extern unsigned char code TeFF1vb[TEFF1_S];
extern unsigned char code TeFF2[TEFF1_S];
extern unsigned char code TeFF3[TEFF3_S];
extern unsigned char code TeFF4[TEFF4_S];
extern unsigned char code TeFF5[TEFF5_S];
#define CPHON_TEMPO (0x5eB61)
#define CPHON1_S (47)
#define CPHON2_S (33)
extern unsigned char code cPhonInitCoord[5];
extern unsigned char code cPhon1[CPHON1_S];
extern unsigned char code cPhon1va[CPHON1_S];
extern unsigned char code cPhon1vb[CPHON1_S];
extern unsigned char code cPhon2[CPHON2_S];
//extern unsigned char code stereoTest1[9];
//#define TEST_LEN 10//easier to parse later
//extern unsigned char code downR1[];
//extern unsigned char code downR2[];
//extern unsigned char code downR3[];
//extern unsigned char code downR4[];
//extern unsigned char code downR5[];
//
//extern unsigned char code upR1[];
//extern unsigned char code upR2[];
//extern unsigned char code upR3[];
//extern unsigned char code upR4[];
//extern unsigned char code upR5[];
//
//
//extern unsigned char code testCo1[];
//extern unsigned char code testCo1b[];
//extern unsigned char code testCo2[];
//
//extern unsigned char code testCo3[];
//extern unsigned char code testCo3b[];
//extern unsigned char code testCo3c[];
//
//extern unsigned char code testCo4[];
#endif