this script is a wrapper for another script I wrote that generates breakbeats from a drum sample. I made this to learn more about sox and aubio as all the audio is generated with those tools.
Requirements
norns
Documentation
press K2 to generate beat
press K3 to toggle playing
use any E to change sample
to “break” a beat, this script first determines the tempo of the input file. it then determines onsets based on the tempo (minimum distance being sixteenth notes) and splits the input file into slices by onset markers. it then takes each slice and manipulates the slice with effects with some probability. the manipulated slice is then appended to an audio file at a position quantized to the desired tempo (set by norns clock). all the effect probabilities are available to modify in the parameters.
deviation: probability of deviating from base pattern (0-100%)
kick: probability of snapping a kick to down beat (0-100%)
snare: probability of snapping a snare to down beat (0-100%)
kick db: volume of added kick in dB (-96-0 dB)
snare db: volume of added snare in dB (-96-0 dB))
all the resulting audio files are automatically put into the ~/dust/audio/makebreakbeat folder.
notes
this script generates beats slowly. to get around this I suggest generating short beats (8-16 beats) continuously (beats continue to play when generating).
run on any linux/mac computer
you don’t need norns to run this script. simply install lua, sox and aubioonset on your computer. (for mac this might involve using brew install aubio-tools sox lua5.3). (for linux this involves doing apt install aubio-tools sox lua5.3). then clone the repo and run:
I will never stop to thank you for your commitment to the script cause , I bet this give you a lot of happiness and it gives us true happiness for sure.
And, when i see an app like that (eg. Amen, Beets…), which give me the chance to make break beats and stuttering, I’m always so excited as I started making electronic music to achieve that kind of style, even if with Norns I started knowing the “looper wave” and started thinking a lil bit more in these terms.
Which differences this script has compared to Amen for example? I’m asking this before trying the app of course, so the question is more related to your “needs” of making it.
I loved the concept of Amen and the fact that I can use a controller like grid which I love, but I never been able to use it perfectly in sync or quantized to my movements actually.
As always, my hopes for a grid UI are big, but right now, I’m going to install this beauty!
to be honest I just wanted to play with sox and see if I could challenge myself to make generative music out of that little tool. I ended up with dnb.lua which can generate breakbeats and even dnb-style basslines. it was fun little project but since I mainly use norns for music stuff I figured I’d put it into a norns script so I can easily access it.
but on another level - this script using “sox” which (mainly) manipulates audio files vs amen which uses SuperCollider that mainly manipulates audio streams. in practice it was easier to implement some cool things using files versus streams. for example: adding reverb to a sound and then reversing it. this is hard to do in SuperCollider (you’d have to render it to a buffer in between, somehow) but its very easy to do with a file-based tool like sox.
Ok, this make sense, I don’t know Sox at all actually, but it’s very clear what you told me.
Talking again about a grid interface (which is clearly my personal obsession) watching the demo, i think is correct to think about this eventuality as redundant, as it seems more like a super nice generative tool to create stuttering loops with a touch of a button ahah…
This looks really cool, but I’m getting an issue where the progress bar doesn’t move at all. Maiden just says ‘resetting’ over and over again. I tried reinstalling and power cycling a few times, but no dice. Anyone got any ideas?
I had the same issue, updated my norns (or actually fates) to the latest version, and now it works. The beats are amazing, yet another gem @infinitedigits! Can’t wait to try it with my own loops…
I’m running on a Fates. Norns is up to date.
I just did a reinstall and reboot and got these results…
First it worked with the supplied amen_resampled.wav Yay!
Then I tried a different wav file and got a syntax error that I think has to do with the parenthesis in the file name.
Then I tried a different file and got some sox Fails and AUBIO errors.
pset >> write: /home/we/dust/data/makebreakbeat/makebreakbeat-01.pset
lua /home/we/dust/code/makebreakbeat/lib/dnb.lua --no-logo --snare-file /home/we/dust/code/makebreakbeat/lib/snare.wav --kick-file /home/we/dust/code/makebreakbeat/lib/kick.wav -t 175 -b 9 -o /home/we/dust/audio/makebreakbeat/175_1.wav -i /home/we/dust/audio/makebreakbeat/amen_resampled.wav --deviation 10 --reverse 10 --stutter 20 --pitch 5 --trunc 2 --half 1 --reverb 5 --stretch 2 --kick 50 --snare 20 --snare-mix -6 --kick-mix -6 &
running command!
found 14 onsets
resetting
filename: /tmp/breaktemp-a9hP6gU5.wav
sample rate: 48000
channels: 2
tempo: 177 bpm
resetting
generated 9 beats into '/home/we/dust/audio/makebreakbeat/175_1.wav' @ 175 bpm
resetting
resetting
resetting
resetting
resetting
resetting
pset >> write: /home/we/dust/data/makebreakbeat/makebreakbeat-01.pset
lua /home/we/dust/code/makebreakbeat/lib/dnb.lua --no-logo --snare-file /home/we/dust/code/makebreakbeat/lib/snare.wav --kick-file /home/we/dust/code/makebreakbeat/lib/kick.wav -t 175 -b 9 -o /home/we/dust/audio/makebreakbeat/175_3.wav -i /home/we/dust/audio/makebreakbeat/5th Dimension - Rainmaker (part1).wav --deviation 10 --reverse 10 --stutter 20 --pitch 5 --trunc 2 --half 1 --reverb 5 --stretch 2 --kick 50 --snare 20 --snare-mix -6 --kick-mix -6 &
sh: 1: Syntax error: "(" unexpected
running command!
resetting
resetting
resetting
resetting
pset >> write: /home/we/dust/data/makebreakbeat/makebreakbeat-01.pset
lua /home/we/dust/code/makebreakbeat/lib/dnb.lua --no-logo --snare-file /home/we/dust/code/makebreakbeat/lib/snare.wav --kick-file /home/we/dust/code/makebreakbeat/lib/kick.wav -t 175 -b 9 -o /home/we/dust/audio/makebreakbeat/175_3.wav -i /home/we/dust/audio/makebreakbeat/20th Century - Hot Pants.wav --deviation 10 --reverse 10 --stutter 20 --pitch 5 --trunc 2 --half 1 --reverb 5 --stretch 2 --kick 50 --snare 20 --snare-mix -6 --kick-mix -6 &
running command!
sox FAIL formats: can't open input file `/home/we/dust/audio/makebreakbeat/20th': No such file or directory
sox FAIL formats: can't open input file `/home/we/dust/audio/makebreakbeat/20th': No such file or directory
sox FAIL formats: can't open input file `/home/we/dust/audio/makebreakbeat/20th': No such file or directory
AUBIO ERROR: source_sndfile: Failed opening /tmp/breaktemp-gSVYWgHI.wav (System error : No such file or directory.)
AUBIO ERROR: source_wavread: Failed opening /tmp/breaktemp-gSVYWgHI.wav (No such file or directory)
Error: could not open input file /tmp/breaktemp-gSVYWgHI.wav
lua: /home/we/dust/code/makebreakbeat/lib/dnb.lua:33: attempt to perform arithmetic on local 'number' (a nil value)
stack traceback:
/home/we/dust/code/makebreakbeat/lib/dnb.lua:33: in function </home/we/dust/code/makebreakbeat/lib/dnb.lua:29>
(tail call): ?
/home/we/dust/code/makebreakbeat/lib/dnb.lua:398: in function 'new'
/home/we/dust/code/makebreakbeat/lib/dnb.lua:986: in main chunk
[C]: ?
resetting
resetting
I also found that I can get the amen sample working again if I re-select it and delete breaktemp-progress from /tmp.
Daaaaaamn this gives me a wild idea of making a plugin or extension for the ranger file manager (written in python) where it can “preview” audio files by having Aubio analyze and “chop” it into relevant slices and then use SoX to scrub/navigate through the slices… and then trim/process any interesting bits into a new file… and … and
Crap this gives me ideas! Thanks for sharing
Edit: holy crap this might be a big deal Aubio and youtube_dl play nicely together, which could mean that needing to actually download files in order to look for interesting slices might just be obsolete for me aubio : /20171004-1234_online_songs.html
whooops! yeah that looks to be a bug. glad you figured it out, I can put a fix on that.
that sounds very cool…like file ranger as a daw aubioonsets gives really pretty good onset detection and once they are split into little units it gives a lot of interesting ways to play.
what I really like about sox though is its ability to splice audio. it allows you to specify a “leeway” which is used with a “wave similarity comparison” to best determine the best place to join:
not only that, but it will crossfade the two clips (the “excess”) so it can very easily make great “cuts”. this is basically the basis of makebreakbeat.
happy to shoot around ideas if you have. I’ve been digging into sox a lot so its at the forefront of my head right now lol.
this can give some wild things. here’s the Michael Jackson one I made:
Nice! I also discovered that the other issue I was having was being caused by spaces in the file names of the samples I was using. Not sure if that is just a limitation or not.
Should I try and remove the pset? Thought maybe it was because no Amen installed, but did that
again and still loops back into resetting, resetting etc. Will admit that have been having off behaviour with the Shield since the last system update, probably Knob Goblins.