diff --git a/music.asm b/music.asm index ee6faa8..74cd971 100644 --- a/music.asm +++ b/music.asm @@ -11,6 +11,12 @@ ; is a soft sine, but pulse carries better here) ; voice 2: drums (sfx 61, TIC-80 noise -> SID noise, ; C-1 = kick, C-4 = snare) +; voice 3: echo canon: repeats the bass melody 2 rows +; (~170 ms) later, 3 octaves up, with the sfx 56 +; pluck timbre (triangle, decaying envelope); +; repeated notes bounce up one more octave. The +; echo data lives on the same 128-row grid as the +; bass, so the two voices can never drift apart. ; Original timing: tempo 150, speed 5 = 12 rows/s at 60 Hz. ; On PAL (50 Hz) that is 25 frames per 6 rows, so every ; sixth row lasts 5 frames instead of 4 (see spd_tbl). @@ -53,6 +59,8 @@ BASS_ON = $41 ; pulse + gate (much louder than triangle, BASS_OFF = $40 ; so the bass stands out from the drums) DRUM_ON = $81 ; noise + gate DRUM_OFF = $80 +LEAD_ON = $11 ; triangle + gate (soft pluck, stays +LEAD_OFF = $10 ; behind the bass and the drums) SONG_LEN = 128 ; 2 frames x 64 rows @@ -77,6 +85,10 @@ mi_clr: sta SID_V2_AD lda #$00 sta SID_V2_SR + lda #$06 ; lead: pluck, ~200 ms decay to zero + sta SID_V3_AD ; (matches the sfx 56 envelope) + lda #$00 + sta SID_V3_SR lda #$0f ; master volume = 15 sta SID_VOL @@ -142,12 +154,12 @@ mp_bass_note: ; ---- voice 2: drums ---- mp_drums: lda drum_pat,x - beq mp_next + beq mp_lead cmp #1 bne mp_drum_note lda #DRUM_OFF sta SID_V2_CR - jmp mp_next + jmp mp_lead mp_drum_note: and #$7f tay @@ -160,6 +172,21 @@ mp_drum_note: lda #DRUM_ON sta SID_V2_CR + ; ---- voice 3: arpeggio lead ---- +mp_lead: + lda lead_pat,x ; only notes here, no key-off events: + beq mp_next ; the envelope decays to silence + and #$7f + tay + lda lead_flo,y + sta SID_V3_FL + lda lead_fhi,y + sta SID_V3_FH + lda #LEAD_OFF + sta SID_V3_CR + lda #LEAD_ON + sta SID_V3_CR + mp_next: inx cpx #SONG_LEN @@ -207,6 +234,10 @@ bass_fhi: !byte $04,$03,$05,$05 ; 0 = C-1 kick (low rumble), 1 = C-4 snare (bright) drum_flo: !byte $9c,$ff drum_fhi: !byte $45,$ff +; lead echo: bass notes +3 octaves (0-3), +4 octaves (4-7) +; 0 = C-5, 1 = A#4, 2 = D#5, 3 = F-5, 4 = C-6, 5 = A#5, 6 = D#6, 7 = F-6 +lead_flo: !byte $ce,$02,$64,$76,$9c,$04,$c8,$eb +lead_fhi: !byte $22,$1f,$29,$2e,$45,$3e,$52,$5c ; ---- pattern data: one byte per row per voice ---- ; $00 = nothing, $01 = key off, $80|n = play note n @@ -228,3 +259,14 @@ drum_pat: !byte $80,$00,$00,$00,$00,$00,$80,$00,$81,$00,$00,$00,$00,$00,$00,$00 !byte $80,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 !byte $80,$00,$00,$00,$00,$00,$80,$00,$81,$00,$00,$00,$00,$00,$00,$00 +; the bass_pat notes shifted 2 rows later; repeated notes take the +; octave-up variant (indices 4-7), alternating with the base octave +lead_pat: + !byte $00,$00,$80,$00,$00,$00,$00,$00,$84,$00,$00,$00,$00,$00,$81,$00 + !byte $80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$84,$00,$00,$00,$00,$00,$80,$00,$00,$00,$00,$00,$81,$00 + !byte $80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$84,$00,$00,$00,$00,$00,$80,$00,$00,$00,$00,$00,$81,$00 + !byte $80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + !byte $00,$00,$82,$00,$86,$00,$00,$00,$82,$00,$00,$00,$00,$00,$86,$00 + !byte $83,$00,$00,$00,$87,$00,$00,$00,$83,$00,$87,$00,$00,$00,$83,$00