Sorting algorithms are fundamental to computer science for the same reason sorting is important in your day to day life. It’s a lot easier to find things when they’re in order, which saves time and energy. Depending on how you need an array sorted, there are many sorting algorithms that you can use. Timo Bingmann made a software called Sound of Sorting which “both visualizes the algorithms internals and their operations, and generates sound effects from the values being compared.”
You can get a glimpse of how it works in this video produced by Bingmann.
The white bars represent the value of the array position corresponding to the x-axis. When an array item is set, the white bar turns red. A swap operation is two bars turning red which represents their values is being exchanged.
The sound’s frequency is calculated for each set of compared values. The sound wave is triangular and modulated to sound like an “8-bit game”, which is either very fitting or excruciatingly annoying.
You can download the software program here and then make your own sounds and videos.