Hemmingsson / dancemusic.wtf

Quiz Game for Learning Electronic Dance Music Styles
http://dancemusic.wtf/
51 stars 5 forks source link

Sample genres first, then tracks #1

Closed reuben closed 6 years ago

reuben commented 6 years ago

While playing the game I noticed some bias in the chosen songs, where common genres would be played often, while the less well known genres would rarely be played.

Looking at the code, I noticed that it's sampling from all tracks and making sure the genres are unique. This means genres with more songs in them like Detroit Techno and Acid House are more likely to be played than Glitch Hop or Dutch House. It's not a huge bias as most genres in the dataset have around 20 songs in them, but if you want to have a more uniform genre distribution, this PR does that.

I restructured src/data/data.json to have tracks keyed by genre, and updated drawNewRound to sample four genres first, then one track from each genre, which should sample all genres uniformly regardless of how many tracks they contain.

I also fixed a mismatch between the genres list and the tracks themselves: the "Trancecore / Acidcore" genre was listed as "Trancecore & Acidcore" in the tracks.

Hemmingsson commented 6 years ago

Thanks, much better!