Thanks to a couple people's puzzled questions, I just realized that I wrote a pretty great bug a couple days ago in my code that makes the main genre map for Every Noise at Once. It needs to play one example song for each genre, so when my other code that makes a whole playlist for each genre runs, it copies the lead-off song from each playlist into another file for use by the main map. The genre playlists have logic that tries very hard to put songs in order by how well they represent the genre, so the first track is hopefully the one with the best combination of cultural and acoustic relevance. As you go down the list, you get further from the center.
The line that saved a genre track for use by the main map was inside the loop of code that picked all the genre-playlist tracks. It correctly saved just a single track, so that was good. But it did so every time the playlist code picked any track, not just the first time. So it saved the best track, and then it saved the second-best track over the best track, and it kept doing that until it had saved the worst track on the playlist as the "best" example! And then it smugly stopped.
It is an oblique and kind of impressive testimony to how well the whole process works that most of the worst examples were basically still plausible. And the bug prompted me to look more closely at the cutoff criteria, and tweak things so that sufficiently dubious tracks towards the end of the genre playlists aren't included at all.
But as perverse results of small-seeming errors go, that was pretty impressive.
The line that saved a genre track for use by the main map was inside the loop of code that picked all the genre-playlist tracks. It correctly saved just a single track, so that was good. But it did so every time the playlist code picked any track, not just the first time. So it saved the best track, and then it saved the second-best track over the best track, and it kept doing that until it had saved the worst track on the playlist as the "best" example! And then it smugly stopped.
It is an oblique and kind of impressive testimony to how well the whole process works that most of the worst examples were basically still plausible. And the bug prompted me to look more closely at the cutoff criteria, and tweak things so that sufficiently dubious tracks towards the end of the genre playlists aren't included at all.
But as perverse results of small-seeming errors go, that was pretty impressive.