djmSorter BubbleSort

Bubble Sort that will sort table data of arbitrary length; also permute or reverse order

(20 Votes)
2.0 (Updated 16 years ago)
February 22, 2005
Reaktor 5 or lower


This a demo for a macro that will sort data in table. The macro should work with any length of data, but is set up at the moment for a table with max length of 40. Increase this by following tooltips in the macro.

The demo has a random intializer, a permuter for scrambling order of the data, and a sorter; also a function for reversing the order of data. After each operation, the data is displayed in CList's event watcher so you can check it. It looks to me like it's working; if you find bugs, report them. Don't know how this will work re. CPU in an CPU intensive instrument.

Done in response to Rolix's thread in the Forum; based on the Permute macro in my ToneRow macro. This version fixes a bug with the permute function and adds a reverse function.


Marcus Hobbs
16 years ago
Hi David, I'm interested in using your bubblesort for some microtonal scales that created on-the-fly. I'm programming-savvy, but after looking inside bubblesort I can tell you I'm not as reaktor-programming savvy as you are. If I have say 15 scale degrees that i've calculated, how do i get them in the table to be sorted? It's never been clear to me how to iterate over a bunch of inputs to populate a table. Any tutorials on the forum for this? Any help is appreciated. Marcus