forked from Protonerd/FX-SaberOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoundfont.h
287 lines (259 loc) · 7.04 KB
/
Soundfont.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
/*
* Soundfont.h
*
* Created on: 21 Octber 2016
* author: Sebastien CAPOU (neskweek@gmail.com) and Andras Kun (kun.andras@yahoo.de)
* Source : Source : https://github.com/Protonerd/FX-SaberOS
* Description: Soundfont Config file for FX-SaberOS
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
*/
#ifndef SOUNDFONT_H_
#define SOUNDFONT_H_
#if defined DIYINO_PRIME or defined DIYINO_STARDUST_V3
#define SOUNDFONT_QUANTITY 18
#define NR_CONFIGFOLDERFILES 29
#define NR_JUKEBOXSONGS 0
#define NR_FILE_SF 30
#else if defined DIYINO_STARDUST_V2
#define SOUNDFONT_QUANTITY 3
#define NR_CONFIGFOLDERFILES 29
#define NR_JUKEBOXSONGS 0
#define NR_FILE_SF 16
#endif
class SoundFont {
public:
SoundFont() {
ID=0;
powerOnTime =500;
powerOffTime = 500;
}
;
~SoundFont() {
/*
delete ID;
delete boot;
delete powerOn;
delete powerOff;
delete hum;
delete swing;
delete clash;
delete lockup;
delete blaster;
*/
}
;
void setID(uint16_t id) {
/*
uint16_t boot[2];
uint16_t powerOn[2];
uint16_t powerOff[2];
uint16_t hum[2];
uint16_t swing[2];
uint16_t clash[2];
uint16_t lockup[2];
uint16_t blaster[2];
uint16_t menu[2];
*/
this->ID = id;
switch (id) {
#if defined DIYINO_PRIME or defined DIYINO_STARDUST_V3
default:
case 0:
// soundFont directory 01 :
this->powerOnTime = 300;
this->powerOffTime = 300;
break;
case 1:
// soundFont directory 02 :
this->powerOnTime = 700;
this->powerOffTime = 900;
break;
case 2:
// soundFont directory 03 :
this->powerOnTime = 500;
this->powerOffTime = 500;
break;
case 3:
// soundFont directory 04 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 4:
// soundFont directory 05 :
this->powerOnTime = 700;
this->powerOffTime = 1500;
break;
case 5:
// soundFont directory 06 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 6:
// soundFont directory 07 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 7:
// soundFont directory 08 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 8:
// soundFont directory 09 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 9:
// soundFont directory 10 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 10:
// soundFont directory 11 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 11:
// soundFont directory 12 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 12:
// soundFont directory 13 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 13:
// soundFont directory 14 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 14:
// soundFont directory 15 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 15:
// soundFont directory 16 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 16:
// soundFont directory 17 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
case 17:
// soundFont directory 18 :
this->powerOnTime = 700;
this->powerOffTime = 600;
break;
#else if DIYINO_STARDUST_V2
default:
case 0:
// soundFont directory 01 :
this->powerOnTime = 300;
this->powerOffTime = 300;
break;
case 1:
// soundFont directory 02 :
this->powerOnTime = 700;
this->powerOffTime = 900;
break;
case 2:
// soundFont directory 03 :
this->powerOnTime = 500;
this->powerOffTime = 500;
break;
#endif // DIYINO_PRIME
}
}
#if defined DIYINO_PRIME or defined DIYINO_STARDUST_V3 // 30 files per sound font
#define SF_BOOT_OFFSET 1
#define SF_POWERON_OFFSET 2
#define SF_POWEROFF_OFFSET 6
#define SF_SWING_OFFSET 8
#define SF_CLASH_OFFSET 16
#define SF_LOCKUP_OFFSET 24
#define SF_BLASTER_OFFSET 25
#define SF_MENU_OFFSET 29
#define SF_HUM_OFFSET 30
#define SF_BOOT_NR 1
#define SF_POWERON_NR 4
#define SF_POWEROFF_NR 2
#define SF_SWING_NR 8
#define SF_CLASH_NR 8
#define SF_LOCKUP_NR 1
#define SF_BLASTER_NR 4
#define SF_MENU_NR 1
#define SF_HUM_NR 1
#else if DIYINO_STARDUST_V2 // 18 files per sound font
#define SF_BOOT_OFFSET 1
#define SF_POWERON_OFFSET 2
#define SF_POWEROFF_OFFSET 3
#define SF_SWING_OFFSET 4
#define SF_CLASH_OFFSET 8
#define SF_LOCKUP_OFFSET 12
#define SF_BLASTER_OFFSET 13
#define SF_MENU_OFFSET 15
#define SF_HUM_OFFSET 16
#define SF_BOOT_NR 1
#define SF_POWERON_NR 1
#define SF_POWEROFF_NR 1
#define SF_SWING_NR 4
#define SF_CLASH_NR 4
#define SF_LOCKUP_NR 1
#define SF_BLASTER_NR 2
#define SF_MENU_NR 1
#define SF_HUM_NR 1
#endif
uint8_t getID() const {
#ifdef LINKEDLIST
return this->ID;
#else
return 1;
#endif
}
const uint16_t getBlaster(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_BLASTER_OFFSET + random(0,SF_BLASTER_NR);
}
const uint16_t getBoot(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_BOOT_OFFSET;
}
const uint16_t getClash(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_CLASH_OFFSET + random(0,SF_CLASH_NR);
}
const uint16_t getHum(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_HUM_OFFSET + random(0,SF_HUM_NR);
}
const uint16_t getLockup(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_LOCKUP_OFFSET + random(0,SF_LOCKUP_NR);
}
const uint16_t getPowerOff(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_POWEROFF_OFFSET + random(0,SF_POWEROFF_NR);
}
const uint16_t getPowerOn(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_POWERON_OFFSET + random(0,SF_POWERON_NR);
}
const uint16_t getSwing(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_SWING_OFFSET + random(0,SF_SWING_NR);
}
const uint16_t getMenu(uint16_t offset = 0) {
return NR_CONFIGFOLDERFILES + NR_JUKEBOXSONGS + offset + SF_MENU_OFFSET;
}
uint16_t getPowerOffTime() const {
//uint16_t powerOffTime=500;
return powerOffTime;
}
uint16_t getPowerOnTime() const {
//uint16_t powerOnTime=500;
return powerOnTime;
}
private:
uint16_t ID;
uint16_t powerOnTime;
uint16_t powerOffTime;
};
#endif /* SOUNDFONT_H_ */