-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
274 lines (269 loc) · 5.13 KB
/
index.js
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
const musicGenres = {
Alternative: [
"Alternative Rock",
"College Rock",
"Experimental Rock",
"Goth Rock",
"Grunge",
"Hardcore Punk",
"Hard Rock",
"Indie Rock",
"New Wave",
"Progressive Rock",
"Punk",
"Shoegaze",
"Steampunk",
],
Blues: [
"Acoustic Blues",
"Chicago Blues",
"Classic Blues",
"Contemporary Blues",
"Country Blues",
"Delta Blues",
"Electric Blues",
],
Country: [
"Alternative Country",
"Americana",
"Bluegrass",
"Contemporary Bluegrass",
"Contemporary Country",
"Country Gospel",
"Honky Tonk",
"Outlaw Country",
"Traditional Bluegrass",
"Traditional Country",
"Urban Cowboy",
],
Electronic: [
"Ambient",
"Crunk",
"Downtempo",
"Electro",
"Electronica",
"Electronic Rock",
"Industrial",
"Breakbeat",
"Dubstep",
"Exercise",
"Garage",
"Hardcore",
"Hard Dance",
"Hi-NRG / Eurodance",
"House",
"Jackin House",
"Jungle/Drum’n'bass",
"Techno",
"Trance",
"Acid Breaks",
"Chill Out",
"Drumstep",
"Jazzstep",
"Liquid Funk",
"Glitchstep",
"Post Dubstep",
"Dubtronica",
"Alternative Dance",
"Coldwave",
"Darkwave",
"Synthpop",
"Breakcore",
"Synthwave",
"Trancecore",
"Hard House",
"Acid House",
"Progressive House",
"Aggrotech",
"Dark Electro",
"Acid Techno",
"Progressive Trance",
"Psychedelic Trance ",
],
Hip_Hop_Rap: [
"Alternative Rap",
"Bounce",
"Dirty South",
"East Coast Rap",
"Gangsta Rap",
"Hardcore Rap",
"Hip-Hop",
"Latin Rap",
"Old School Rap",
"Rap",
"Underground Rap",
"West Coast Rap",
"Alternative Hip-Hop",
"Battle Rap",
"Crunk",
"Southern Rap",
"Trap",
"Country Rap",
"Rap Rock",
"G-funk",
],
Jazz: [
"Acid Jazz",
"Avant-Garde Jazz",
"Big Band",
"Blue Note",
"Contemporary Jazz",
"Cool",
"Crossover Jazz",
"Dixieland",
"Ethio-jazz",
"Fusion",
"Hard Bop",
"Latin Jazz",
"Mainstream Jazz",
"Ragtime",
"Smooth Jazz",
"Trad Jazz",
"Swing Jazz",
],
Latino: [
"Alternativo & Rock Latino",
"Baladas y Boleros",
"Brazilian",
"Contemporary Latin",
"Latin Jazz",
"Pop Latino",
"Raíces",
"Reggaeton y Hip-Hop",
"Regional Mexicano",
"Salsa y Tropical",
],
Metal: [
"Heavy Metal",
"Thrash Metal",
"Death Metal",
"Black Metal",
"Doom Metal",
"Stoner Metal",
"Sludge",
"Blackened Death",
"Blackened Thrash",
"Grindcore",
"Deathgrind",
"Metalcore",
"Deathcore",
"Melodic Death Metal",
"Progressive Metal",
"Progressive Death Metal",
"Funeral Doom",
"Groove Metal",
"Folk Metal",
"Industrial Metal",
"Funk Metal",
"Hair Metal",
"Sothern Metal",
"Goregrind",
"Nu Metal",
"Power Metal",
"New Wave of British Heavy Metal",
"New Wave of American Heavy Metal",
"Post Black Metal",
"Post Metal",
"Crossover Thrash",
"Gothic Metal",
"Alternative Metal",
"Symphonic Metal",
"Symphonic Black Metal",
"Symphonic Death Metal",
"Death 'n' Roll",
"Technical Death Metal",
"Death Doom",
"Speed Metal",
"Mathcore",
"Djent",
],
Pop: ["Adult Contemporary", "Britpop", "Pop Rock", "Soft Rock", "Teen Pop"],
Punk: [
"Afro Punk",
"Anarcho Punk",
"Art Punk",
"Christian Punk",
"Crust Punk",
"Deathrock",
"Garage Punk",
"Glam Punk",
"Hardcore Punk",
"Horror Punk",
"Oi!",
"Queercore",
"Riot Grrrl",
"Skate Punk",
"Street Punk",
"Celtic Punk",
"Folk Punk",
"Pop Punk",
"Ska Punk",
"D-beat",
"Emo",
"Post Hardcore",
"Powerviolence",
"Screamo",
"Thrashcore",
],
R_B_Soul: [
"Contemporary R&B",
"Disco",
"Doo Wop",
"Funk",
"Motown",
"Neo-Soul",
"Quiet Storm",
"Soul",
],
Reggae: ["Dancehall", "Dub", "Roots Reggae", "Ska"],
Rock: [
"Arena Rock",
"Blues-Rock",
"British Invasion",
"Glam Rock",
"Hard Rock",
"Prog-Rock/Art Rock",
"Psychedelic Rock",
"Rock & Roll",
"Rockabilly",
"Roots Rock",
"Southern Rock",
"Surf Rock",
"Post Grunge",
"Classic Rock",
"Garage Rock",
"Math Rock",
"Post Rock",
"Soft Rock",
],
};
// Returns all genres - object holding genres
function getAllGenres() {
return musicGenres;
}
// Returns random genre - array holding subgenres
function getRandomGenre() {
return musicGenres[
Object.keys(musicGenres)[
Math.floor(Math.random() * Object.keys(musicGenres).length)
]
];
}
// Returns random subgenre - string
function getRandomSubgenre() {
let key =
musicGenres[
Object.keys(musicGenres)[
Math.floor(Math.random() * Object.keys(musicGenres).length)
]
];
let length = key.length;
return key[Math.floor(Math.random() * length)];
}
module.exports = {
getAllGenres: getAllGenres,
getRandomGenre: getRandomGenre,
getRandomSubgenre: getRandomSubgenre,
};
// Genres: 13
// Subgenres: 222