AudioHit - Open-source CLI for Sample Batch Processing

AudioHit

AudioHit is a Rust-based CLI (command-line interface aka terminal app) designed to batch process samples in many different ways in order to create better workflows for hardware and software samplers.

It can perform many different tasks such as:

  • Process single or an entire folder of samples (including sub-folders)
  • Automatically trimming and fading samples
  • Split long recordings into separate files (aka a simple silent strip)
  • Speed up or slow down samples
  • Automatically create an Octatrack sample chain (concatenated wav + .ot file) with generated samples
  • Create chains by selecting random files from folder
  • Create equally-spaced chains
  • Create transposed copies of a sample
  • Add reference tone to sample

What’s cool about AudioHit is that many of these features can be used together. For example, it’s possible to split a single recording of multiple one-shots into separate files, automatically trim and fade each one of them, speed each one up by 4x, and group them back together into a single .wav file using the command:

audiohit --ot_file true --split true --speedup 4 --folder /path/to/folder

This can significantly speed up the process of preparing samples to use in samplers such as the Octatrack, MPC, Circuit, etc. It also has the side benefit of reducing RAM usage due to the automatic trimmming.

AudioHit currently only works with 44.1 / 16 / mono wav files (but it will auto-convert wav samples in other formats).

I wrote AudioHit for my personal use so it’s definitely not bug-free but I hope to keep improving it as I go.
I’m always open to suggestions as well!

Requirements

  • macOS (binaries for other OSes can be compiled by following the instructions on the repo)
  • SoX

Documentation

Please refer to the GitHub repository for complete documentation.

Download

19 Likes

This is great! Could adding higher sample rates be a possibility in the future?

Yes, that’s definitely something I want to add very soon

2 Likes

Hey, I’m finally testing Audiohit today…

Does it mean it will convert stereo to mono too or just the sample rate and bit rate ? Perhaps it needs mono files as input only ? (Edit: I get the same error with mono files) That might explain the following error it returns when trying to create an OT file from the terminal. Do you know what’s happening ?

AUDIOHIT - DEVELOPED BY ICARO FERRE

Version 0.6

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseBoolError { _priv: () }', src/main.rs:172:21

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I put the binary in /documents/_scripts and added an alias for it, installed Sox and “authorized” the script manually first (ctrl + open on Mac Os Catalina otherwise it will complain the developer is not registered)

thanks :wink:

Yes it’ll convert stereo to mono as well (or it should at least).

That error actually seems to be related to rust failing to parse the value for the ot_random argument. AudioHit was expecting a value of true or false but it got something else.

Here’s what the command should look like for ot_random:
audiohit --folder /path/to/folder --ot_file true --ot_random true

1 Like

Ah, ok.
I was using the example command from the readme on github
audiohit --mode pass --ot_file true --ot_random 64 --folder /users/...

I’m trying again with
audiohit --folder /path/to/folder --ot_file true --ot_random true but now for some reason it returns “zsh: command not found: audiohit”

I’m gonna try a few things and report back :slight_smile:

Edit:
I re-entered the alias and then
audiohit --folder $(pwd) --ot_file true --ot_random true in a test folder, the script starts but it stops during the process. I think I know why: there are only 21 files in my “test folder” ^^

Nice! Yeah I’m still looking for a better solution than creating aliasing since they’re temporary. It’s possible to just copy the binary to the /usr/bin folder but it requires disabling system integrity protection which is not something I’d recommend anyone to do.

And yes, it’s probably bugging out because it can’t find 64 files haha I’ll make sure to fix that asap.

1 Like

Great :slight_smile: thanks. Do you think there’s a possibility to specify an output folder too or is this implemented already ?

I’m trying in a larger folder but again I get this "zsh: command not found: audiohit" It’s probably due to the OS itself and not the script, I don’t understand why I need to enter the alias multiple times. I’ll investigate that