A score is written and a tune is what the machine reads

The convention, at the user's asking, and it is the one this project
already has everywhere else: a .asm is written and a .sbx or a .bin is
what the machine loads. A .score and a .tune are the same pair one
subject along.

It is not only tidiness. I read the user's splash.tune as a compiled tune
yesterday, dumped its header, and got a tick of seven and a half million
cycles and ninety seven patches out of what was plainly a text file.
Different names make that a thing nobody has to notice.

AND THE SPLASH WAS SILENT ON THE DISK THAT MATTERS. The play disk mirrors
every .asm and puts every app, and nothing on it put a compiled tune - so
make run-cosmos and make run-voyager both booted a Lander that read
/splash.tune, did not find one, and held the logo in silence. Only the
test disk had it, because I had added it there and stopped.

The makefile now compiles Programs/Tunes/splash.score with TuneC and puts
the result on the disk, and the mirror's prerequisite list learned about
.score files so that changing the music rebuilds the disk. That is the
same failure the mirror was built for, in a file type the mirror did not
know about yet: tune.asm went into Examples once, the image was not
remade, and it was simply not there.

Measured on the real disk: music from 0.9 s to 9.6 s.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-06 10:24:39 -04:00
co-authored by Claude Opus 5
parent 00b31b88af
commit dfc9d9ef7f
9 changed files with 39 additions and 15 deletions
+4 -4
View File
@@ -180,7 +180,7 @@ printf '#! script\nfor a in 1 2\n for b in x y\n echo $a$b\n end\nend\nset
# touching the game. Lander reads it off the disk at startup and starts anyway if it is not
# there, the way it treats /lander.state.
"$ROOT/SoundPatch" --blob "$ROOT/Programs/Sounds/Oboe.json" Oboe "$WORK/oboe.patch" >/dev/null
"$ROOT/TuneC" -I "$WORK" "$ROOT/Programs/Tunes/splash.tune.txt" "$WORK/splash.tune" >/dev/null
"$ROOT/TuneC" -I "$WORK" "$ROOT/Programs/Tunes/splash.score" "$WORK/splash.tune" >/dev/null
"$TOOL" put "$DISKS/cosmos.img" "$WORK/splash.tune" splash.tune >/dev/null
# tune.sbx, which used to be a boot image and is now a program like any other. It brings a
@@ -744,13 +744,13 @@ def blob(octave):
open(sys.argv[1], "wb").write(blob(128))
open(sys.argv[2], "wb").write(blob(129))
FIXTURE
"$ROOT/TuneC" -I "$WORK" "$ROOT/Programs/Tunes/two.tune.txt" "$WORK/compiled.tune" >/dev/null
"$ROOT/TuneC" -I "$WORK" "$ROOT/Programs/Tunes/two.score" "$WORK/compiled.tune" >/dev/null
# The same tune at half the speed. A TICK BELONGS TO THE TUNE, and the only reason nothing
# noticed that Play was ignoring it was that every fixture asked for the tick Play happened to
# have written into itself. One that asks for something else is the whole check.
sed 's/#Tick 0d125000/#Tick 0d250000/' "$ROOT/Programs/Tunes/two.tune.txt" > "$WORK/slow.tune.txt"
"$ROOT/TuneC" -I "$WORK" "$WORK/slow.tune.txt" "$WORK/slow.tune" >/dev/null
sed 's/#Tick 0d125000/#Tick 0d250000/' "$ROOT/Programs/Tunes/two.score" > "$WORK/slow.score"
"$ROOT/TuneC" -I "$WORK" "$WORK/slow.score" "$WORK/slow.tune" >/dev/null
"$TOOL" put "$DISKS/quiet.img" "$WORK/slow.tune" slow.tune >/dev/null
"$ROOT/Assembler" -I "$ROOT/Programs/Sounds" -I "$ROOT/Programs/Libraries" \
-I "$ROOT/Programs/CosmOS/Source" \
+4 -4
View File
@@ -865,9 +865,9 @@ PY2
refuses() {
# refuses <what it should say> <line>...
local want="$1"; shift
printf '%s\n' "$@" > "$BUILD/bad.tune.txt"
printf '%s\n' "$@" > "$BUILD/bad.score"
local said
said="$("$ROOT/TuneC" -I "$ROOT/Tests/build/.diskwork" "$BUILD/bad.tune.txt" \
said="$("$ROOT/TuneC" -I "$ROOT/Tests/build/.diskwork" "$BUILD/bad.score" \
"$BUILD/bad.tune" 2>&1)"
if [ -f "$BUILD/bad.tune" ]; then rm -f "$BUILD/bad.tune"; fi
case "$said" in
@@ -893,8 +893,8 @@ PY2
printf '%s\n' "#Tick 0d125000" "#Patch A nosuch.patch" \
"#Voice 0d0 A" "#Voice 0d1 A" "#Voice 0d2 A" \
"#Sequence S" "0d60 0d4" \
"#Order 0d0" "S" "#Order 0d1" "S" "#Order 0d2" "S" > "$BUILD/cascade.tune.txt"
SAID="$("$ROOT/TuneC" "$BUILD/cascade.tune.txt" "$BUILD/cascade.tune" 2>&1 \
"#Order 0d0" "S" "#Order 0d1" "S" "#Order 0d2" "S" > "$BUILD/cascade.score"
SAID="$("$ROOT/TuneC" "$BUILD/cascade.score" "$BUILD/cascade.tune" 2>&1 \
| grep -c "cannot find\|no patch of that name\|no instrument")"
[ "$SAID" = "1" ] \
&& result ok "TuneC says a missing patch once" "one message, not one for every use of it" \