| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #!/bin/sh
- # Builds mpckit-checkpoint-a.zip: the projects for device checkpoint A
- # (build plan section 7), written by the Go writer through mpckit-cli.
- # Usage: tools/checkpoint-a/build.sh [output.zip] (run from the repo root)
- set -eu
- out=${1:-mpckit-checkpoint-a.zip}
- work=$(mktemp -d)
- trap 'rm -rf "$work"' EXIT
- cli="$work/mpckit-cli"
- gentone="$work/gentone"
- go build -o "$cli" ./cmd/mpckit-cli
- go build -o "$gentone" ./tools/checkpoint-a/gentone
- f="testdata/device/DemoFile_[ProjectData]"
- kick="$f/80s-Kik-Dreamer2 SA.wav"
- snare="$f/80s-Snr-Dreamer SA.wav"
- hat1="$f/80s-Hat-Dreamer1 SA.wav"
- hat2="$f/80s-Hat-Dreamer2 SA.wav"
- bass="$f/Bass-Pure C.wav"
- tones="$work/tones"
- mkdir -p "$tones" "$work/pack"
- # A1 kit, A2 tuning extremes, A3 mute group 1 choke, A5 1 and 64 bars.
- "$cli" -name MpckitKit -out "$work/pack" \
- -pad "A1=$kick" -pad "A2=$snare" -pad "A3=$hat1" -pad "A4=$hat2" -pad "B1=$bass" \
- -mute A3=1 -mute A4=1 \
- -copy B1:B2 -tune B2=-24,0 \
- -copy B1:B3 -tune B3=24,0 \
- -copy B1:B4 -tune B4=0,-90 \
- -copy B1:B5 -tune B5=0,90 \
- -copy B1:B6 -tune B6=-24,-90 \
- -copy B1:B7 -tune B7=24,90 \
- -seq "1=One Bar,120,1" -seq "2=Long,120,64"
- # A3 high mute groups: does the device accept 16 and 32 in a file?
- "$cli" -name MpckitMute -out "$work/pack" \
- -pad "A1=$hat1" -pad "A2=$hat2" -pad "A3=$hat1" -pad "A4=$hat2" \
- -mute A1=16 -mute A2=16 -mute A3=32 -mute A4=32
- # A5 BPM extremes.
- "$cli" -name MpckitTempo -out "$work/pack" \
- -pad "A1=$kick" \
- -seq "1=Slow,30,2" -seq "2=Fast,300,2" -seq "3=Very Slow,20,2" -seq "4=Very Fast,999,2"
- # Extensible WAV headers (build plan section 7, "Not yet tested").
- "$gentone" "$tones/44k 16bit mono.wav"
- "$gentone" -rate 48000 -bits 24 -channels 2 -extensible "$tones/48k 24bit stereo extensible.wav"
- "$gentone" -rate 44100 -bits 16 -channels 2 -extensible "$tones/44k 16bit stereo extensible.wav"
- "$gentone" -rate 44100 -bits 16 -channels 1 -extensible "$tones/44k 16bit mono extensible.wav"
- "$cli" -name MpckitWav -out "$work/pack" \
- -pad "A1=$tones/44k 16bit mono.wav" \
- -pad "A2=$tones/48k 24bit stereo extensible.wav" \
- -pad "A3=$tones/44k 16bit stereo extensible.wav" \
- -pad "A4=$tones/44k 16bit mono extensible.wav"
- rm -f "$out"
- (cd "$work/pack" && python3 -m zipfile -c "$work/out.zip" *)
- mv "$work/out.zip" "$out"
- echo "wrote $out"
|