- tools/opl/render_opl.cpp: libADLMIDI harness - renders MIDI through OPL3 emulation with game-driver volume models (DMX/Doom, Apogee/Duke, AIL, HMI), normalised output, WAV header patched to actual length - tools/opl/build.sh: one-shot fetch+build of libADLMIDI - tools/render_opl.sh: batch render + check_wav for all tunes - README: OPL3 section
19 lines
737 B
Bash
Executable File
19 lines
737 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# build.sh — fetch and build libADLMIDI, then compile render_opl.
|
|
# Idempotent: skips anything already present. Run once per machine.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
LIBDIR="${OPL_LIBDIR:-/opt/libADLMIDI}"
|
|
|
|
if [ ! -f "$LIBDIR/build/libADLMIDI.a" ]; then
|
|
echo "cloning libADLMIDI..."
|
|
git clone --depth 1 -q https://github.com/Wohlstand/libADLMIDI.git "$LIBDIR"
|
|
echo "building (a few minutes)..."
|
|
cmake -B "$LIBDIR/build" -S "$LIBDIR" -DCMAKE_BUILD_TYPE=Release >/dev/null
|
|
cmake --build "$LIBDIR/build" -j"$(nproc)" --target ADLMIDI_static >/dev/null
|
|
fi
|
|
|
|
g++ -O2 -I "$LIBDIR/include" render_opl.cpp "$LIBDIR/build/libADLMIDI.a" \
|
|
-o render_opl -lpthread
|
|
echo "built: $(pwd)/render_opl"
|