diff --git a/src/inst.asm b/src/inst.asm index 76f4b88d..23271bde 100644 --- a/src/inst.asm +++ b/src/inst.asm @@ -64,6 +64,7 @@ D_TABLE_HI table, Data_Instruments_func_ptr_1_arr D_TABLE .enum, eInst d_entry table, Constant, Func_InstrumentConstant + d_entry table, NoiseSnare, Func_InstrumentNoiseSnare d_entry table, PulseBasic, Func_InstrumentPulseBasic d_entry table, PulseEcho, Func_InstrumentPulseEcho d_entry table, PulsePiano, Func_InstrumentPulsePiano @@ -108,7 +109,7 @@ _Vibrato: ;; instrument for pitches right next to a TimerLo carry boundary, then ;; TimerHi wouldn't change anyway, and everything will sound fine. _Envelope: - fall Func_InstrumentPulseBasic + fall Func_InstrumentPulseBasic ; preserves X .ENDPROC ;;; A basic instrument for the pulse channels. The bottom four bits of the @@ -181,7 +182,7 @@ _Decay: div #2 rsub Zp_AudioTmp1_byte ; max volume blt Func_InstrumentSilent - fall Func_CombineVolumeWithDuty + fall Func_CombineVolumeWithDuty ; preserves X .ENDPROC ;;; Combines the given volume value with the pulse duty bits from the @@ -249,6 +250,26 @@ _VibratoDelta_i8_arr4: rts .ENDPROC +;;; An instrument for the pulse and noise channels. The bottom four bits of +;;; the instrument param specify the initial volume, which starts fading out +;;; immediately. The top four bits of the instrument param specify a delta to +;;; add to the noise period (mod 16) after the initial hit. +;;; @param X The channel number (0-4) times four (so, 0, 4, 8, 12, or 16). +;;; @return A The duty/envelope byte to use. +;;; @preserve X +.PROC Func_InstrumentNoiseSnare + lda Ram_Music_sChanNote_arr + sChanNote::ElapsedFrames_u8, x + cmp #2 + bne @done + lda Ram_Music_sChanInst_arr + sChanInst::Param_byte, x + div #$10 + add Ram_Music_sChanNote_arr + sChanNote::TimerLo_byte, x + mod #$10 + sta Hw_Channels_sChanRegs_arr5 + sChanRegs::TimerLo_wo, x + @done: + fall Func_InstrumentStaccato ; preserves X +.ENDPROC + ;;; An instrument for the pulse and noise channels. The bottom four bits of ;;; the instrument param specify the initial volume, which starts fading out ;;; immediately. The top two bits of the instrument param specify the pulse @@ -261,7 +282,7 @@ _VibratoDelta_i8_arr4: and #bEnvelope::VolMask sub Ram_Music_sChanNote_arr + sChanNote::ElapsedFrames_u8, x bge Func_CombineVolumeWithDuty - fall Func_InstrumentSilent + fall Func_InstrumentSilent ; preserves X .ENDPROC ;;; An instrument for the pulse and noise channels that silences the channel. @@ -314,7 +335,7 @@ _Slide: sta Ram_Music_sChanNote_arr + sChanNote::TimerHi_byte, x @done: _Vibrato: - fall Func_InstrumentTriangleVibrato + fall Func_InstrumentTriangleVibrato ; preserves X .ENDPROC ;;; An instrument for the triangle channel that applies vibrato. The diff --git a/src/inst.inc b/src/inst.inc index c1d955a5..451a9bb6 100644 --- a/src/inst.inc +++ b/src/inst.inc @@ -20,6 +20,7 @@ ;;; Instruments that can be used for music notes. .ENUM eInst Constant + NoiseSnare PulseBasic PulseEcho PulsePiano diff --git a/src/music/boss1.sng b/src/music/boss1.sng index 3071de72..ee953cbb 100644 --- a/src/music/boss1.sng +++ b/src/music/boss1.sng @@ -2,7 +2,7 @@ !DPCM K Data_SampleKickDrum_arr657 657 -!SONG Boss1 "A|BCCADDEEFFEEGGAB" +!SONG Boss1 "A|BCCHDDEEFFEEGGAB" =tempo q28 =key 3# % F# minor @@ -77,3 +77,10 @@ T| pTA ' pTA | | pTG | N| pNA :8 | D| pDA :16 | + +!PART H + +2=:A2 +T=:AT +N=:AN +D=:AD diff --git a/src/music/title.sng b/src/music/title.sng index 4dab0f81..6989872e 100644 --- a/src/music/title.sng +++ b/src/music/title.sng @@ -1,16 +1,38 @@ @PRGC_Title -!SONG Title "|A" +!SONG Title "D|ABC" -=tempo q30 -=key 2# % D major +=tempo q40 +=key 3b % c minor -!INST 1U RampUp $00 -!INST TD TriangleDrum $20 -!INST ND Staccato $0c +!INST 1H PulsePiano $08 d1/2 +!INST 1Q PulsePiano $08 d1/4 +!INST TV TriangleVibrato +!INST NS NoiseSnare $27 % snare drum + +!PART D + +T| iV c3w | e3w | a2h b2h | c3h. b2q | +N| p(iS x5e x4e+ ' +e x5s x4t x4t ' x5e x4e ' rq)NA :3 | + | p(iS x5e x4s x5s+ ' +s x4s x4t x4t x4t x4t ' x5e x4e ' x5e x4s x4t x4t)NB | !PART A -1| iU d4e re d3q a3 d3 | -T| iD c4e re :4 | -N| iD x9e x0 :4 | +1| p(iQ g4e. fe. ce+q+e ave | a4e. ge. fe+q+e ce | g4e. fe. ce+q bvq)1A | + | e4q+e fh ce | + | p(iQ g4e. fe. ce+q+e ave | a4e. iH be. iQ c^e bve.+e. ce | + | a4e. ge. ee fq bvq | c4w)1B | +T| iV c3w | f3w | e3w | a2h b2h | + | c3w | a3w | a2h b2h | c3h. b2q | +N| pNB :8 | + +!PART B + +1| p1A | a3q e4q b3q+e c4e | p1B | +T=:AT +N=:AN + +!PART C + +T=:AT +N| pNA | pNA | pNB | pNA | pNA | pNA | pNA | pNB |