A simple Multi-Track Audio Sampler to splice up bars consistently across synchronised audio stems.
It takes up multiple synchronised .wav stem tracks (bass, drums, vocals, etc.) and slices them based on your selected musical segments (bars / milliseconds).
Exports the resulting samples into new files in the same directory.
Python 3.13+ is not supported due to removed dependencies.
pydubffmpeg
git clone https://github.com/yourusername/multitrack-audio-slicer.git
cd multitrack-audio-slicerbrew install [email protected]if encountering filepath issues, run, otherwise ignore
brew link [email protected] --force --overwrite/opt/homebrew/bin/python3.11 -m venv venv
source venv/bin/activatepip install pydub
brew install ffmpeg- Place
.wavfiles in same folder as the script. - Update the
filesdictionary with your filenames. - Define segments/regions to splice up using either of the two options:
- Bar ranges: (
start_bar,end_bar) - Milliseconds: (
start_ms,end_ms) - Set
USE_BARSto True/False respectively.
- Bar ranges: (
- Run script
python AudioSampler.py- You can adjust
SHIFT_MS- Optional manual offset (in milliseconds) to compensate for silence or pre-roll at the start of the audio file. - If you re-run script with changes made, originally generated files get overwritten (fix by changing filenames!)
- I recommend using Demucs if you have your audiofile but the different stem tracks are not split up yet!