FYI.

This story is over 5 years old.

Tech

Sorting Through Data Sounds Totally Insane

Take that in the most literal sense. There is no such thing as silence, even within the thickest stacks and complex processing of raw numerical information.
via tbingmann

Take that in the most literal sense. There is no such thing as silence, even within the thickest stacks and complex processing of raw numerical information.

Take sorting algorithms. You can think of a sorting algorithm as a chain of calculations that takes select elements from an existing list and then rearranges them into a given order. More often this means a pair of these elements are compared before getting rearranged according to size.

Advertisement

It's a basic enough concept, and yet in no small way it has kept the proverbial "sorting problem"--what happens when you need to sort a set of n elements but must make due with only a subset of "all possible pairwise element comparisons" (pdf)--hanging around since the advent of computing. That's why sorting algorithms (there are quite a few) are fixtures in introductory computer science curricula.

So it could be for want of engaging study supplements, sexing up the cold, hard sciences, staving off of sheer boredom, or some cocktail thereof, that has some coders not only animating sorting algorithm visualizations (SAVs) but sonifying them, too. And it turns out getting your shit in line has never sounded this crazy.

Crazy like The Sound of Sorting. Part chip-tune nightmare, part graphs on meth, the aptly titled supercut seen above sorts "random shuffles of integers" whose speeds and item counts, according to the video's description, are fitted to the intricacies of each of 15 distinct sorting algorithms. In order of appearance: selection sort, insertion sort, quick sort, merge sort, heap sort, radix sort (LSD), radix sort (MSD), std::sort (intro sort), std::stable_sort (adaptive merge sort), shell sort, bubble sort, cocktail shaker sort, gnome sort, bitonic sort, and bogo sort.

Such highly, highly technical nomenclature. If it's still a bit much, this single sorting algorithm visualization might be a bit easier to digest:

Advertisement

There are a number of ways to crank noise out of a running sorting algorithm. Per andrut, the coder behind this solo SAV:

On every comparison of two numbers (elements) I play (mix) sin waves with frequencies modulated by values of these numbers. There are quite a few parameters that may drastically change resulting sound - I just chose parameteres that imo felt best.

Then there's the guy who wrote a simple script in the audio programming language ChucK that bubble sorts a list of integers before converting the values of each pair of compared elements "from a MIDI note value to a frequency." From there, two tones ring out at those frequencies.

If that's not doing it for you, this musical sorting algorithm, likewise a MIDI jam but arguably more, you know, pure, could be more up to your speed:

Is this math rock?

Of course, there are those for whom animated SAVs, and presumably their loud cousins, simply fall flat.

For Aldo Cortesi, the New Zealand-based coder and security consultant behind the SAV project Sortvis, animated SAVs do nothing but mystify. "There's too much of an air of hocus-pocus" over SAVs, he wrote in 2007.

Sound good?

@thebanderson