Give the demo a real tune: the Anachronaut Labs theme

The composition is the user's - a leitmotif they already have variants of,
written into the note table by hand. It replaces the eight note scale that
was there to prove a note could be played at all, and it is a better demo
for the obvious reason and one less obvious one: it is long enough to hear
whether the machine keeps time, which a run of eight notes is not.

Forty five notes, 567 frames, 9.45 seconds, peaking at 19,461 of 32,767.
The test budget goes to twelve million cycles, which is a duration rather
than a guess: at 16,667 cycles a frame the music is 9.45 million, so there
is room to add bars before anybody has to come back here.

Also records what borrowing the screen's frame actually costs, which came
out of writing music rather than out of theory. The frame is not too slow,
it is FIXED: every duration is a whole number of 16.67 ms, so a note worth
a third of a beat cannot be written, and the way round it is choosing a
tempo whose subdivisions land on whole frames - making the tune fit the
machine. That is the argument for the timer peripheral wanting an arbitrary
tick rather than a faster fixed one, and for the screen not being the clock:
a display refresh and a music routine have no reason to share a rate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-08-29 22:33:33 -04:00
co-authored by Claude Opus 5
parent 85329f13c3
commit 2f22807458
2 changed files with 86 additions and 6 deletions
+76 -1
View File
@@ -17,6 +17,18 @@
; Borrowing the screen's frame costs nothing and works, which is the whole reason to notice
; that a beat is a beat wherever it comes from.
;
; ---- What borrowing it costs ----
;
; The frame is not slow. It is FIXED, and that is the different complaint. Every duration here
; is a whole number of 16.67 ms, so a note worth a third of a beat cannot be written at all -
; and the way round it is to pick a tempo whose subdivisions happen to land on whole frames,
; which is making the tune fit the machine rather than the other way round. The theme below
; was written to the frame and is a few cents of tempo away from what it wants to be.
;
; So what the timer wants is an ARBITRARY tick rather than a faster fixed one, and the reason
; the screen should not be the clock is that a display refresh and a music routine have no
; reason to share a rate.
;
; ---- What a patch costs and what a note costs ----
;
; Setting the sound up is twenty-odd writes, done once before a single note is played. After
@@ -137,7 +149,7 @@ start:
;
; Data Pointer 0 walks the table, and nothing in this loop is a CALL, so it stays where it
; was left without being saved anywhere.
SETD.0 Tune
SETD.0 Theme
nextNote:
LDA.0 ; The note. Zero is the end of the tune.
@@ -197,6 +209,69 @@ Tune:
0d60 0d45 ; and home
0x00
Theme:
0x30 0d15 ; C
0x35 0d15 ; F
0x3C 0d15 ; C+
0x40 0d30 ; E+
0x48 0d30 ; C++
0x45 0d30 ; A+
0x47 0d30 ; B+
0x43 0d45 ; G+
; repeat four times.
0x2A 0d7 ; Gs
0x33 0d7 ; Ef
0x3C 0d7 ; C+
;
0x2A 0d7 ; Gs
0x33 0d7 ; Ef
0x3C 0d7 ; C+
;
0x2A 0d7 ; Gs
0x33 0d7 ; Ef
0x3C 0d7 ; C+
;
0x2A 0d7 ; Gs
0x33 0d7 ; Ef
0x3C 0d7 ; C+
; next chord
0x2E 0d7 ; Bf
0x35 0d7 ; F
0x3E 0d7 ; D+
; next chord
0x2E 0d7 ; Bf
0x35 0d7 ; F
0x3E 0d7 ; D+
;
; next chord
0x2E 0d7 ; Bf
0x35 0d7 ; F
0x3E 0d7 ; D+
;
; next chord
0x2E 0d7 ; Bf
0x35 0d7 ; F
0x3E 0d7 ; D+
; Finally on the C major
0x30 0d7 ; C
0x37 0d7 ; G
0x40 0d7 ; E+
;
0x30 0d7 ; C
0x37 0d7 ; G
0x40 0d7 ; E+
;
0x30 0d7 ; C
0x37 0d7 ; G
0x40 0d7 ; E+
;
0x30 0d7 ; C
0x37 0d7 ; G
0x40 0d7 ; E+
;
0x18 0d60 ; C bass
0x00
#Vectors
Boot start