Jump to content
IGNORED

the sound of various sorting algorithms


kaini

Recommended Posts

This particular audibilization is just one of many ways to generate sound from running sorting algorithms. Here on every comparison of two numbers (elements) I play (mixing) 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.

 

but i actually remember a QBASIC demo program which came with MS-DOS5.0 which did exactly this, albeit with monophonic square-wave beeps pitched to the difference between subsequent comparisons within the sort data. it didn't sound that different.

Link to comment
Share on other sites

there are lots of different methods (algorithms) for sorting a big list of random numbers

this is various different algorithms rendered as audio and video

Link to comment
Share on other sites

I did some investigations about zipf distributions a while back. Basically I tried to see to which extends two zipf graphs can be different by using two word frequency lists (they both contain exactly the same words) so as to work out:

X (rank of the word in the A list)

Y ( abs(rank in A - rank in B) ).

 

 

Here is what I got

melodieux1.jpg

 

And here is how this kind of stuff sound with metasynth.

MetaSynth 4 Demo Session 20090701 0102.mp3

 

 

BUT IT APPEARED THAT

1. I wasn't able to reproduce these shapes with random arbitrary datas.

2. These shapes were mainly caused by the sorting algorithm itself.

 

So i wrote my own sorting algorithm in order to keep the sorting randomized (or something like that), and finally, i achieved getting something homogenous.

http://www.youtube.com/watch?v=HgbXNNKY5JE

(in this vid i'm gradually adding words (=dots) to the graph. When the number of words in the graph is above 100 000, you can see the curve is no longer homogenous. And I can only hope this non-heterogeneity is not caused by some algorithmic artefact ).

 

 

[/uNINTERESTING POST]

 

edit : metasynth is quite crappy because it uses scales in order to convert pics to music. Anyone willing to convert the pic I posted to a sound with something else than metasynth ?

Link to comment
Share on other sites

Epic as all hell.

 

wtf is a Gnome sort though?

 

just observe - it kinda skips forward until the second data point is smaller than first in a comparison, then skips back to put that data point in the correct place. suppose the way it 'runs forwards and back, tidying shit' is what made the person who named it think 'gnome'

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.