build.sh 2.3 KB

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