diff --git a/Programs/Tunes/intro.score b/Programs/Tunes/intro.score new file mode 100644 index 0000000..e2b601e --- /dev/null +++ b/Programs/Tunes/intro.score @@ -0,0 +1,67 @@ +; Four bars, and the bass is the same one under two of them. +#Tick 0d125000 ; cycles a tick: a sixteenth note at 120 beats a minute + +#Patch Oboe oboe.patch + +#Voice 0d0 Oboe ; which instrument each voice starts on +#Voice 0d1 Oboe +#Voice 0d2 Oboe +#Voice 0d3 Oboe + +#Sequence MotifA + 0x30 0d2 + 0x00 0d2 + 0x3C 0d2 + 0x00 0d4 + 0x48 0d4 + 0x00 0d4 + 0x47 0d4 + 0x00 0d6 + ; 28 beats + +#Sequence MotifB + 0x00 0d2 + 0x35 0d2 + 0x00 0d2 + 0x40 0d4 + 0x00 0d4 + 0x45 0d4 + 0x00 0d4 + 0x43 0d6 + + +#Sequence IntroQuiet + 0x00 0d28 + +#Sequence ChordRoot + 0x2C 0x4 + 0x2E 0x4 + 0x30 0x4 + +#Sequence ChordFifth + 0x33 0x4 + 0x35 0x4 + 0x37 0x4 + +#Sequence ChordThird + 0x3C 0x4 + 0x3E 0x4 + 0x40 0x4 + +#Sequence ChordQuiet + 0x00 0d12 + +#Sequence Bass + 0x24 0x8 + +#Order 0d0 + MotifA ChordRoot + +#Order 0d1 + MotifB ChordFifth + +#Order 0d2 + IntroQuiet ChordThird + +#Order 0d3 + IntroQuiet ChordQuiet Bass diff --git a/Programs/Tunes/splash.score b/Programs/Tunes/splash.score index e2b601e..60ba581 100644 --- a/Programs/Tunes/splash.score +++ b/Programs/Tunes/splash.score @@ -6,62 +6,55 @@ #Voice 0d0 Oboe ; which instrument each voice starts on #Voice 0d1 Oboe #Voice 0d2 Oboe -#Voice 0d3 Oboe #Sequence MotifA 0x30 0d2 0x00 0d2 0x3C 0d2 - 0x00 0d4 - 0x48 0d4 - 0x00 0d4 - 0x47 0d4 0x00 0d6 - ; 28 beats + #Sequence MotifB 0x00 0d2 0x35 0d2 0x00 0d2 - 0x40 0d4 - 0x00 0d4 - 0x45 0d4 - 0x00 0d4 - 0x43 0d6 + 0x41 0d6 +; Truncate Anachronaut motif to three introductory notes. #Sequence IntroQuiet - 0x00 0d28 + 0x00 0d12 -#Sequence ChordRoot - 0x2C 0x4 - 0x2E 0x4 - 0x30 0x4 +; new Chords are C-maj, A-maj. "Seeeee-gaaaan" -#Sequence ChordFifth - 0x33 0x4 - 0x35 0x4 - 0x37 0x4 +#Sequence ChordA + ; C + 0x30 0d6 + ; A + 0x2D 0d6 -#Sequence ChordThird - 0x3C 0x4 - 0x3E 0x4 - 0x40 0x4 +; One continuous note here makes the chords blend together better. + +#Sequence ChordB + ; E+ + 0x34 0d12 + +#Sequence ChordC + ; G+ + 0x37 0d6 + ; Cs+ + 0x3D 0x6 #Sequence ChordQuiet 0x00 0d12 -#Sequence Bass - 0x24 0x8 +; The extra rests on the end prevent the splash screen from ending before the voices are silent. #Order 0d0 - MotifA ChordRoot + MotifA ChordA IntroQuiet #Order 0d1 - MotifB ChordFifth + MotifB ChordB IntroQuiet #Order 0d2 - IntroQuiet ChordThird - -#Order 0d3 - IntroQuiet ChordQuiet Bass + IntroQuiet ChordC IntroQuiet diff --git a/SplitBit Tune Manual.md b/SplitBit Tune Manual.md index 468aee7..70b03c9 100644 --- a/SplitBit Tune Manual.md +++ b/SplitBit Tune Manual.md @@ -103,6 +103,8 @@ Nothing is written when anything is refused, so a failed build cannot leave a ha ./SplitDisk put mydisk.img theme.tune ``` +In this repository, `Programs/Tunes` holds the scores and the build compiles every one of them onto the disk - the source mirrored to `/Source/Tunes` with everything else that was written, and the compiled tune at the root, where a program looking for one expects to find it. + **A `.score` is written and a `.tune` is what the machine reads**, the same way a `.asm` is written and a `.sbx` or a `.bin` is what it loads. One is a source and the other is bytes, and giving them different names means never wondering which a file is - or handing a player a source and being told, correctly, that it is not a tune. Then `Play theme.tune` on the machine. diff --git a/Tests/expected/cosmosCrossDisk.out b/Tests/expected/cosmosCrossDisk.out index d5821db..ab74516 100644 --- a/Tests/expected/cosmosCrossDisk.out +++ b/Tests/expected/cosmosCrossDisk.out @@ -31,7 +31,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosDrives.out b/Tests/expected/cosmosDrives.out index 011400e..6fa4505 100644 --- a/Tests/expected/cosmosDrives.out +++ b/Tests/expected/cosmosDrives.out @@ -21,7 +21,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosFault.out b/Tests/expected/cosmosFault.out index 3a8d8b4..3dd0ae9 100644 --- a/Tests/expected/cosmosFault.out +++ b/Tests/expected/cosmosFault.out @@ -38,7 +38,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosFlip.out b/Tests/expected/cosmosFlip.out index 2b05b35..6d96688 100644 --- a/Tests/expected/cosmosFlip.out +++ b/Tests/expected/cosmosFlip.out @@ -28,7 +28,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosGrid.out b/Tests/expected/cosmosGrid.out index 83cdf44..800c39a 100644 --- a/Tests/expected/cosmosGrid.out +++ b/Tests/expected/cosmosGrid.out @@ -28,7 +28,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosMonitor.out b/Tests/expected/cosmosMonitor.out index b4b4059..f6f074a 100644 --- a/Tests/expected/cosmosMonitor.out +++ b/Tests/expected/cosmosMonitor.out @@ -114,7 +114,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosMonitorRun.out b/Tests/expected/cosmosMonitorRun.out index b7df3ea..8422b4c 100644 --- a/Tests/expected/cosmosMonitorRun.out +++ b/Tests/expected/cosmosMonitorRun.out @@ -33,7 +33,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosRun.out b/Tests/expected/cosmosRun.out index d37e513..4310ad7 100644 --- a/Tests/expected/cosmosRun.out +++ b/Tests/expected/cosmosRun.out @@ -21,7 +21,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosSlowDisk.out b/Tests/expected/cosmosSlowDisk.out index 015e538..241f9cb 100644 --- a/Tests/expected/cosmosSlowDisk.out +++ b/Tests/expected/cosmosSlowDisk.out @@ -19,7 +19,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/expected/cosmosSprite.out b/Tests/expected/cosmosSprite.out index 53c7df0..bcc8497 100644 --- a/Tests/expected/cosmosSprite.out +++ b/Tests/expected/cosmosSprite.out @@ -28,7 +28,7 @@ Crash.sbx 632 vars.script 50 blocks.script 343 loops.script 272 -splash.tune 218 +splash.tune 189 tune.sbx 318 Play.sbx 2526 notes.txt 21 diff --git a/Tests/makedisks.sh b/Tests/makedisks.sh index 9ac5087..57081f8 100755 --- a/Tests/makedisks.sh +++ b/Tests/makedisks.sh @@ -744,12 +744,12 @@ 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.score" "$WORK/compiled.tune" >/dev/null +"$ROOT/TuneC" -I "$WORK" "$ROOT/Tests/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.score" > "$WORK/slow.score" +sed 's/#Tick 0d125000/#Tick 0d250000/' "$ROOT/Tests/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" \ diff --git a/Programs/Tunes/two.score b/Tests/two.score similarity index 97% rename from Programs/Tunes/two.score rename to Tests/two.score index 79b2185..a155616 100644 --- a/Programs/Tunes/two.score +++ b/Tests/two.score @@ -1,4 +1,4 @@ -; two.score +; Tests/two.score ; The smallest thing that is a tune: one voice, two sequences, and an instrument change. ; Written by Anachronaut ; diff --git a/makefile b/makefile index 5adfec1..af73302 100644 --- a/makefile +++ b/makefile @@ -639,11 +639,25 @@ $(COSMOS_DISK): $(APPS) $(NATIVE_ASM) $(COSMOS) $(STAGE2) \ @# written and a .sbx is what it loads. The patches come from SoundPatch, which stays the @# only thing that knows what a soundThing patch means; TuneC embeds the bytes and knows @# nothing about them. + @# EVERY SCORE, NOT A NAMED ONE. A list here goes stale the moment somebody writes a + @# second piece of music, and what they forgot is invisible until they go looking for + @# it on the machine - which is the same argument the mirror above is made of, and the + @# same way it went wrong the first time: splash.score was named and intro.score sat + @# beside it compiling into nothing. + @# + @# The patches every score can name are converted first. They come from SoundPatch, + @# which stays the only thing that knows what a soundThing patch means. @mkdir -p $(PROG_BUILD)/tunes - $(PATCH_RUN) --blob $(PROG_DIR)/Sounds/Oboe.json Oboe $(PROG_BUILD)/tunes/oboe.patch - $(TUNE_RUN) -I $(PROG_BUILD)/tunes $(PROG_DIR)/Tunes/splash.score \ - $(PROG_BUILD)/tunes/splash.tune - $(DISKTOOL) put $@ $(PROG_BUILD)/tunes/splash.tune splash.tune + @for json in $(PROG_DIR)/Sounds/*.json; do \ + $(PATCH_RUN) --blob $$json `basename $$json .json` \ + $(PROG_BUILD)/tunes/`basename $$json .json | tr 'A-Z' 'a-z'`.patch \ + >/dev/null || exit 1; done + @for score in $(PROG_DIR)/Tunes/*.score; do \ + name=`basename $$score .score`; \ + $(TUNE_RUN) -I $(PROG_BUILD)/tunes $$score $(PROG_BUILD)/tunes/$$name.tune \ + >/dev/null || exit 1; \ + $(DISKTOOL) put $@ $(PROG_BUILD)/tunes/$$name.tune $$name.tune >/dev/null \ + || exit 1; done @# ---- What you assemble: all of it ---- @# @# MIRRORED RATHER THAN LISTED. A list in a makefile goes stale the moment somebody