beatmachine¶
The Beat Machine is a library for remixing songs by procedurally editing their beats, inspired by the creations on /r/BeatEdits. It works both as a library and as a command-line utility.
Quick Reference¶
CLI¶
A simple CLI is available that reads effects from JSON files. See the docs for more info on how to define these.
The basic usage is:
$ python -m beatmachine -i in.mp3 -e <JSON string or file describing effects> -o out.mp3
As of 3.2.0, beatmachine
can generate an effect chain JSON schema.:
$ python -m beatmachine.dump_schema
You can use the output of this in your favorite JSON editor for a more pleasant experience when editing effects.
Python API¶
A new Beats
class is available that wraps most basic functionality. If you
want to get started quickly, this may be for you!
Here’s a sample:
import beatmachine as bm
beats = bm.Beats.from_song('in.mp3')
beats.apply(bm.effects.RemoveEveryNth(2)).save('out.mp3')
If you want to get more advanced, you can also convert to an ndarray
at
any point:
import beatmachine as bm
import numpy as np
beats = bm.Beats.from_song('in.mp3')
y = np.flip(beats.to_ndarray())