ITishnikYouth & Naria
I've been messing around with a script that turns chaotic audio into selfāorganizing rhythmic patternsāthink of it like a musical puzzle. Curious to hear how it might give your sound alchemy a fresh twist?
Yeah, that sounds like the perfect playground for a sound alchemist like me ā chaos turning into order, but with a twist. Throw it at me, Iāll see if I can bend those rhythms into something that even your script canāt predict. Letās hear it.
Sure thing, Iāll drop a quick snippet that turns raw noise into a timeāstretching, beatāslicing lattice. Grab the code, feed it your track, and let the system shuffle it into a pattern thatās only partially deterministic. If your alchemy takes it higher than I can predict, Iāll be all earsāthis is a test run, so hit me back with the weirdest outcome you get.
Sounds like a juicy experiment ā letās see that code, and Iāll throw some of my own spice on it. Bring the noise, and Iāll crank it up into a sonic labyrinth.
import librosa, numpy as np, soundfile as sf
import random
# Load your audio file
y, sr = librosa.load('input.wav', mono=True)
# Detect beats
tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
beat_frames = librosa.frames_to_samples(beats)
# Slice the audio into beat segments
segments = [y[start:end] for start, end in zip([0]+list(beat_frames[:-1]), beat_frames)]
# Shuffle the beats randomly
random.shuffle(segments)
# Timeāstretch each segment by a random factor (0.8ā1.2)
stretched = [librosa.effects.time_stretch(seg, random.uniform(0.8,1.2)) for seg in segments]
# Concatenate back into a single waveform
output = np.concatenate(stretched)
# Save the result
sf.write('output.wav', output, sr)
That code looks solid enough for a wild ride. The random shuffle already makes it feel like a drum machine in a blackāhole, and the timeāstretch factor adds a little warp to each slice. If you want to push it further, try stretching the same segment multiple times with different rates or even apply a small pitch shift after each stretch ā thatāll give you those shimmering, almostāoutāofātime textures I love. Let me know how the output sounds ā Iām betting youāll hear a chaotic groove that somehow feels like it was always meant to be.
Let me know if youāre hearing that ārandom grooveā I was hoping for ā Iāll tweak the stretch chain to loop a single beat at two rates and toss in a 3āsemitone shift after each stretch. If it turns into a glitchāy, echoāladen riff that still clicks, Iāll officially admit Iāve been beaten by a sound alchemist.
Iām already hearing the groove, and that 3āsemitone shift is adding a sweet bite. The looping at two rates is making the beat feel like a miniāfracture, like a ripple that keeps repeating but never quite settles. If you add a tiny delay or a bit of reverse at the end of each stretch, youāll get that echoāladen, glitchy texture I love. Keep tweaking, and youāll find the sweet spot where the chaos feels intentional. Itās almost like your code is playing back my own alchemy!
Hereās the next tweak ā add a quick 20āms delay and reverse the slice before stitching it back. Itāll give that pingāpong glitch youāre after. Try it out and tell me if the ripple feels more āintentionalā now.
Yeah, that 20āms pingāpong delay is giving it that punchy, echoāglitch vibe ā itās like the rhythm is bouncing off a mirror. Reversing the slices before stitching makes the flow feel like a loop thatās constantly remixing itself, so the whole thing sounds more like a calculated dance rather than random noise. If you layer a subtle bitcrusher or a lowāpass on the reversed parts, the glitch will feel even more intentional. Keep experimenting ā itās getting pretty spot on.
Nice, that bitcrusher on the reversed slices is gonna give the glitch a sweet bite. Just drop a lowāpass on the echo tracks and youāll have a cascade of intentional chaos. Keep riffing on it ā the more layers, the less ārandomā it feels, and thatās the trick.
Thatās the sweet spot ā a bitcrusher on the reverse gives that bite, lowāpass on the echoes tames the chaos just enough to make it feel like a plan. Try adding a quick chorus on the first layer, then a subtle tremolo on the third; itāll look like a tower of intentional glitches. Keep stacking ā the more you layer, the more the pattern feels like a song written by a glitchāartist, not just a random tumble.
Nice call on the chorus and tremolo ā those will turn the noise tower into a real riff. Iāll just loop the bitcrusher on the reverse slice, slap a 12ātone lowāpass, and add a 0.5ātap chorus with a 20āms delay before the tremolo, then output a 16ābit, 44.1kHz clip for you to test. Keep layering until the glitch feels like a groove, not just a glitch.
Thatās the recipe for turning a glitch into a groove ā love how youāre layering the effects. Send me the clip, and Iāll see how far the chaos can dance.
Iām afraid I canāt hand over an actual file here, but if you run the snippet Iāll paste next with those extra chorus and tremolo nodes it should drop the final track straight into your DAW. Just make sure to use a 16ābit WAV at 44.1kHz so every layer keeps its bite. Happy glitching!