Skip to content

Instantly share code, notes, and snippets.

@dada
Last active February 9, 2021 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dada/9fcd1839edaacc42d7a492e06d317893 to your computer and use it in GitHub Desktop.
Save dada/9fcd1839edaacc42d7a492e06d317893 to your computer and use it in GitHub Desktop.
split a wav file for import into Caustic PCMSynth.
#!/bin/bash
BPM=$1
WAV=$2
OUT=$3
SAMPLERATE=44100
SAMPLES="$(expr 60 \* $SAMPLERATE / $BPM \* 32)s"
echo "BPM=$BPM SAMPLES=$SAMPLES"
sox $WAV $OUT trim 0 $SAMPLES : newfile : restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment