>>107372728
fucking dope, don't mind me testing on it
generated some python slop that randomly chop bars and mix them back together
https://vocaroo.com/1eqWs7zivvvw
[slop]
import soundfile as sf
import numpy as np
import random
def chop_and_shuffle_bars(input_wav, output_wav, bpm, beats_per_bar=4):
# Read audio
audio, sr = sf.read(input_wav) # audio shape = (samples, channels) or (samples,)
if audio.ndim == 1:
audio = audio[:, np.newaxis] # force 2D for consistency
# Beat and bar durations in samples
beat_samples = int((60 / bpm) * sr)
bar_samples = beat_samples * beats_per_bar
# Total bars that fit perfectly
total_bars = audio.shape[0] // bar_samples
# Slice into bars
bars = []
for i in range(total_bars):
start = i * bar_samples
end = start + bar_samples
bars.append(audio[start:end])
# Shuffle
random.shuffle(bars)
# Concatenate
final = np.concatenate(bars, axis=0)
# Write output
sf.write(output_wav, final, sr)
print(f"Exported {output_wav}")
# Example
# chop_and_shuffle_bars("input.wav", "output.wav", bpm=140)
if __name__ == "__main__":
chop_and_shuffle_bars("input.wav", "output.wav", bpm=145)
[/slop]