[HN Gopher] Bubble Sorted Amen Break
       ___________________________________________________________________
        
       Bubble Sorted Amen Break
        
       Author : eieio
       Score  : 230 points
       Date   : 2026-03-12 17:13 UTC (5 hours ago)
        
 (HTM) web link (parametricavocado.itch.io)
 (TXT) w3m dump (parametricavocado.itch.io)
        
       | eieio wrote:
       | (the amen break is one of the most commonly-sampled drum breaks
       | in popular music: https://en.wikipedia.org/wiki/Amen_break)
        
         | zonkerdonker wrote:
         | And a tragic story at that:
         | 
         | >Coleman died homeless and destitute in 2006. It was unlikely
         | he was aware of the impact he had made on music. Neither he
         | [band leader Spencer] nor Coleman received royalties for the
         | break.
        
           | hnlmorg wrote:
           | I've heard conflicting accounts about their knowledge and
           | royalties.
           | 
           | While I'm certain they didn't receive royalties from all
           | artists, I heard many 80s artists did. And Amen Brothers took
           | others to court. So they would have know about the use of the
           | break.
           | 
           | I will admit I haven't done any independent research into
           | this matter personally. Just echoing accounts I've read and
           | taking their reports at face value.
        
             | corndoge wrote:
             | > And Amen Brothers took others to court.
             | 
             | Who is "Amen Brothers"?
        
               | input_sh wrote:
               | "Amen, Brother" is the name of the track it's from, so
               | the parent is likely referring to the band.
        
           | tialaramex wrote:
           | A reminder that your society will be judged not on how the
           | _most_ fortunate lived but how the _least_ fortunate lived.
           | Context still matters but there 's a meaningful difference
           | between "Anne Bronte died of Consumption (Tuberculosis), at
           | that time there was no cure" and "Dave died of TB, he
           | couldn't afford the cure at current market prices".
        
             | verisimi wrote:
             | Sure. Which is your society though?
        
             | fragmede wrote:
             | What is a mote in such a society to do though? Dave
             | couldn't afford the cure, but neither can I. What do you
             | suggest I do to make it affordable for both of us?
        
             | creative-9 wrote:
             | This is our manifesto. We are creative people. Here is our
             | strategy for advancing creative work and supporting the
             | people who do it.
             | 
             | We upvote comments that completely miss the point of how
             | this algorithm works. We upvote comments that claim the
             | algorithm does nothing at all. We downvote comments about
             | how the creator of the original drum break died destitute.
        
           | legitster wrote:
           | "Samples" were kind of like musical memes in the 1980s. What
           | made for a good sample had a lot more to do with convenience
           | and luck. The sounds that were picked for drum samples had
           | more to do with how useful they were - the dynamic range, how
           | isolated the drums are, how easy they were to mix.
           | 
           | The other famous drum sample - the "Funky Drummer" as drummed
           | by Clyde Stubblefield for James Brown, Stubblefield didn't
           | think the particular drum pattern he used was particularly
           | noteworthy. In that case, James Brown's production choices
           | were actually more key - his signature sound revolved around
           | really crisp drums that he insisted needed to be clear on AM
           | Radio and Jukeboxes. Which is what made it so useful for
           | sampling.
        
             | WhiteOwlLion wrote:
             | Samplers became accessible at the time which allowed music
             | production with just loops. Look at snap I got the power.
             | All looped samples
        
               | input_sh wrote:
               | I mean, look at any house or hip-hop track, sampling's
               | like _the_ most fundamental part of both genres.
               | 
               | The track you've mentioned is the prime example of the
               | blend of those two genres. Before the term Eurodance
               | caught on, this track would be referred to as hip-house
               | (as in hip-hop + house). Chicago and the broader NY area
               | did it first, but it was a Belgian track that first
               | topped the US charts (Technotronic's Pump Up The Jam).
        
           | ompogUe wrote:
           | Reminds me of Motown's James Jamerson [1]
           | 
           | [1] https://en.wikipedia.org/wiki/James_Jamerson
        
           | araker wrote:
           | That's true, though there was a community fundraising a while
           | back. Many well known dnb and jungle dj's donated there.
           | 
           | https://ra.co/news/28370
        
       | exDM69 wrote:
       | That's a fun two minutes for any computer scientist drum and bass
       | fan.
        
       | staplung wrote:
       | Cool, but I don't see how it's sorting anything. It just seems to
       | play a randomized arrangement of the slices. You can re-randomize
       | as much as you like but there's no sort option as far as I can
       | see.
        
         | throwuxiytayq wrote:
         | Give it a minute or two.
        
         | dylan604 wrote:
         | Did you play it to the end? It's absolutely sorting from
         | smallest to largest. Unless you have a confused understanding
         | of a bubble sort, it's doing a bubble sort
        
           | hnlmorg wrote:
           | Not the OP but I stopped listening pretty quickly because I
           | was confused about how it was sorted.
           | 
           | It wasn't until I read your comment that I realised the
           | sorting happened while you were listening rather than before
           | hand.
        
             | ricardobeat wrote:
             | Same! thanks for saving the experience for me :)
        
           | lxgr wrote:
           | So it's sorting from earliest to latest, really?
        
             | dylan604 wrote:
             | The value that is being sorted isn't obvious to me. It's
             | obvious that it is sorting it. I'm guessing maybe some dB
             | level of each of the hits/notes. If that was the case, I'd
             | expect the initial unsorted view to line up with the
             | pattern of the waveforms which is _not_ the case. Maybe it
             | 's just an unsorted list of values sorted in sync to the
             | rhythm. It's weird though that the segment corresponds to a
             | segment of the audio. I just don't see how they are linked.
        
               | scrumper wrote:
               | It's sorting by index of the slice. Pressing "shuffle"
               | jumbles the slices up. So it puts the slices of the break
               | back in the correct order. You never hear the result.
               | 
               | Set it to 8 slices and it becomes easy to see what it's
               | doing: look at the waveform and the now-playing highlight
               | jumping around.
        
         | joeypickles wrote:
         | It randomizes slices of the sample and begins to play the
         | slices in the random order. Meanwhile it begins the bubble sort
         | algorithm at a pace that matches the tempo, sorting the slices
         | into their chronological order. Throughout, it only plays the
         | unsorted slices. (I was kinda hoping it would play the sorted
         | sample at the end.)
        
           | icambron wrote:
           | I actually wanted it to play them as it went, so that it
           | would be <unsorted><sorted> each time through, with the
           | former shrinking and the latter growing.
        
         | hyperhello wrote:
         | You're right. It doesn't play the sorted parts, which is
         | strange. I expected to have a series of random-then-controlled
         | slices with the random part getting shorter and the controlled
         | part getting longer, but it really is just a shortening loop of
         | random beats.
        
           | butlike wrote:
           | Would have been cool if it played the sorted ones at the end
           | as a final run through victory lap
        
         | pdpi wrote:
         | The idea is that it slices the Amen Break into however many
         | slices you specify, and the list being sorted is the indices
         | for those slices. At each step, it plays the slice the pivot is
         | being compared to.
         | 
         | Because it only plays the samples being compared, it never
         | plays the sorted chunks, so it's missing a "punchline" of
         | sorts.
        
           | actionfromafar wrote:
           | I was surprised at how _frustrating_ it was to not hear the
           | sorted result at the end.
        
       | sandwell wrote:
       | It sounds like a Ventian Snares track. Love it.
        
       | marssaxman wrote:
       | I can't help laughing. This is great.
       | 
       | I don't understand the comparison function, but it's really
       | enjoyable listening to the algorithm work out its logic.
        
         | cocodill wrote:
         | It's comparing the t value.
        
       | braebo wrote:
       | No sound on iPhone. Shame Apple is so hostile to the web. Tragic
       | really.
        
         | quag wrote:
         | iOS seems to mute the web audio apis when the phone is in
         | silent mode (the switch on the side of the phone). If you
         | toggle it on, then this site (and many others) play sound.
         | 
         | I have no idea why it works this way and it's frequently
         | annoying.
        
           | bigstrat2003 wrote:
           | Why _wouldn 't_ it work that way? Whether it's a hardware
           | toggle like on iPhone or a software one like in Android, I
           | want silent to mean _silent_. Not  "silent but if a web page
           | decides to play sound it can".
        
             | tialaramex wrote:
             | There is some amount of the "Focus follows brain" problem
             | here. What we _want_ is for things to do what we meant, all
             | the time, and in this case it 's very possible that the
             | visitor wanted to hear the music. It is not practical
             | (without yet to invented technology) for that to work so we
             | have a substitute - there's a switch and you should
             | remember to press it.
             | 
             | "Focus follows brain" is how everybody wants windowed UIs
             | to work. When I type on the keyboard the letters go where
             | my brain thought they should go - duh, but of course that's
             | unimplementable, so the Windows UI provides "Click to
             | focus" - if I click on a Window the typing goes there until
             | I click another window, meanwhile some Unix systems do
             | "Focus follows Mouse" - if I move the mouse over a Window
             | then my typing goes there even without clicking. Neither is
             | what we actually wanted, both are trying to approximate.
        
               | dylan604 wrote:
               | Many many times I have music playing in the background
               | from another app while browsing. So no, there's no way to
               | focus follow brain. There's just no way for this device
               | to know what I want unless I tell it
        
             | relaxing wrote:
             | The phone will still make sound if I launch a music app,
             | why is a web page different?
             | 
             | And I hate web pages making sound! But the UX is confusing,
             | and it's changed over the years, seemingly without reason.
             | 
             | Iphones now have a software toggle as well, which may have
             | coincided with the shift from "mute ringer" to "mute
             | (almost) everything" that came with the multifunction
             | button.
        
             | LordDragonfang wrote:
             | Because silent mode is for the _notifications_. App volume
             | has its own dedicated buttons.
        
             | probabletrain wrote:
             | media sound is generally unaffected by the silent mode
             | toggle, which apple suggests is only for notifications. but
             | the toggle inconsistently affects media, muting some things
             | but not others. it's incredibly frustrating. android has
             | much better audio controls for notifications, media,
             | alarms, and vibrate.
        
           | dylan604 wrote:
           | How old of an iPhone does one need to have that switch? My
           | 6S+ has one, but a 15 doesn't.
        
             | sertsa wrote:
             | My 14 has the switch. I believe the 15 is when they
             | switched to a programmable "action" button in place of the
             | switch.
        
         | fragmede wrote:
         | I can hear it. Chrome on iOS 26.
        
       | onionisafruit wrote:
       | I would have expected it to be terrible to listen to, but it was
       | pretty nice.
        
         | moosehater wrote:
         | Yup, this is essentially what the original concept of the
         | Jungle genre was built around. Chop up the Amen Break, mix the
         | notes(?) around, repeat them as you see fit, and add other
         | samples/vocals around the drum patterns you've created.
         | 
         | A couple favorites from the 90s:
         | 
         | https://youtu.be/mL2Bgj-za5k?si=fhXHhNGjA-RZkiD7
         | 
         | https://youtu.be/a5meT63flnM?si=ggvypNCFfUUq3Qxq
        
       | robin_reala wrote:
       | My personal prize for the most chopped amen goes to Breakage's
       | Final mix of Equinox's Acid Rain VIP.
       | https://www.youtube.com/watch?v=LoKlz6_I4vY
        
         | bouk wrote:
         | Wow I've heard pieces of this but never the full thing,
         | incredible
        
         | jamal-kumar wrote:
         | https://www.youtube.com/watch?v=rI5Qlo2Y6Jg
         | 
         | Nice pick! Above that same song but not compressed to hell
         | 
         | I like this one for amen stuff. Heavyweight Vol.4 - Untitled 7
         | 
         | https://www.youtube.com/watch?v=dfyHx7SCn3g
        
         | ChrisArchitect wrote:
         | Worlds colliding here.
         | 
         | We're dropping amen selections now?
         | 
         | Some classics that sound like what the app is sortin':
         | 
         | Remarc - Sound Murderer (Loafin' in Brockley Mix)
         | https://www.youtube.com/watch?v=3SUdpCVITxc
         | 
         | Splash - Babylon https://www.youtube.com/watch?v=7vghx8SEeH8
         | 
         | DJ Krome & Mr. Time - The License
         | https://www.youtube.com/watch?v=yPa5JBg8hZI
         | 
         | Source Direct - Secret Liason
         | https://www.youtube.com/watch?v=xfEWCVoB45s
         | 
         | Danny Breaks - Droppin' Science Vol 1A
         | https://www.youtube.com/watch?v=xqZT-Jse5rQ
        
           | HelloUsername wrote:
           | > We're dropping amen selections now?
           | 
           | Futurama theme! https://www.youtube.com/watch?v=Tz8HmN2uvuk
        
         | butterknife wrote:
         | Hype for Equinox in Sheffield on Sat
        
         | araker wrote:
         | Love that tune. Some of my personal favorites, amen andrews -
         | jungle bunny, doc scott - here comes the drumz (breakage
         | remix), loxy & ink - murder inc (twisted anger remix), pendulum
         | - through the loop, dj hidden - times like these
        
         | prmoustache wrote:
         | I like Bruce Lee Mc by Quincy.
         | 
         | https://www.youtube.com/watch?v=mUqsDy3TD3Y
        
       | oybng wrote:
       | Automatic chopping has existed for decades, popularised here:
       | https://web.archive.org/web/20051225061044/http://www.cus.ca...
       | https://github.com/mdsp/Livecut See also, dblue Glitch,
       | chrisGlitch, Renoise
        
         | bzzzt wrote:
         | Yes, and on many samplers too. The linked website looks like a
         | 'lite' version of the slicer on my Elektron Octatrack ;)
        
       | evereverever wrote:
       | This is bonkers and I love it.
        
       | uoaei wrote:
       | I need WebGL to play audio on HTML pages now?
        
         | probabletrain wrote:
         | it's an application built with webgl that plays audio, rather
         | than just an audio player
        
       | empath75 wrote:
       | Not playing it all the way through at the end is diabolical.
        
       | nvader wrote:
       | This deserves the top spot on the front page!
       | 
       | Might I ask for the implementation of other sorting algorithms
       | here?
        
       | jatari wrote:
       | -100 points for not having a volume slider.
        
       | idontwantthis wrote:
       | Can someone explain the comparison function?
        
       | Retr0id wrote:
       | I wish it'd play through the whole thing in order at the end
        
         | robot_jesus wrote:
         | 100% this. Because I'm a masochist, I let it run through 128
         | random slices. Took maybe 15 mins (wasn't timing or anything).
         | Definitely deserved the payoff at the end to hear the whole
         | thing.
        
         | teach wrote:
         | If you never play the original sample, you never have to worry
         | about royalties.
         | 
         | :rollsafe-think-about-it:
        
           | matsz wrote:
           | Funnily enough, there's a drum loop that's also frequently
           | sampled in electronic music from a track titled "Think (About
           | It)."
           | 
           | https://en.wikipedia.org/wiki/Think_(About_It)
        
         | xg15 wrote:
         | The unshuffled song: https://youtu.be/qwQLk7NcpO4 :)
         | 
         | (Same here - though at least so I learned about the Amen
         | Break.)
        
         | telesilla wrote:
         | You don't know it by heart even yet, after all the time it's
         | been in countless songs?
        
           | Retr0id wrote:
           | I haven't heard it in the original order many times!
        
       | ttyyzz wrote:
       | 429 Too Many Requests
        
       | ykl wrote:
       | If you aren't familiar with the Amen Break, here's a now classic
       | 18 minute documentary on the Amen Break and its origins and
       | evolution:
       | 
       | https://youtu.be/5SaFTm2bcac?si=J99_Sh9x3fIBCSms
        
       | ge96 wrote:
       | Different bubble sort
       | 
       | https://www.youtube.com/watch?v=m4EMG63W388
       | 
       | Or types of sorts
        
       | Negitivefrags wrote:
       | Can we get an Amen quicksort now?
        
       | larodi wrote:
       | tbh i expect it to be much more interesting if doing other kind
       | of sorts
        
       | regus wrote:
       | This afternoon I was getting the oil changed for my car, and
       | while I was in the waiting room the Amen Break started playing
       | from a nearby speaker.
        
       | suzdude wrote:
       | This is unreasonably fun.
        
       | cocodill wrote:
       | At first I didn't understand, but then I did.
        
       ___________________________________________________________________
       (page generated 2026-03-12 23:00 UTC)