;z80 ;zx-spectrum ;assembler ; haiku (c) Gasman 2005 ; music.asm: the music player ; note_base = the tonic of the melody, from which all other notes are calculated with ; simple ratios. (See my article 'Just Intonation: Making music come to life' from ; Subliminal Extacy #3: http://www.pouet.net/prod.php?which=2125 ) ; 249 = a value to send to the AY's pitch registers roughly equalling 440Hz note_base EQU 249 note_F1 EQU note_base * 6 ; 1 note_G1 EQU note_base * 16 / 3 ; 2 note_Ab1 EQU note_base * 5 ; 3 note_C2 EQU note_base * 4 ; 4 note_C3 EQU note_base * 2 ; 5 note_F3 EQU note_base * 3/2 ; 6 note_G3 EQU note_base * 4/3 ; 7 note_Ab3 EQU note_base * 5/4 ; 8 note_A3 EQU note_base * 6/5 ; 9 note_Bb3 EQU note_base * 10/9 ; 10 note_C4 EQU note_base * 1 ; 11 note_D4 EQU note_base * 8/9 ; 12 note_Eb4 EQU note_base * 5/6 ; 13 note_F4 EQU note_base * 3/4 ; 14 note_G4 EQU note_base * 2/3 ; 15 note_Bb4 EQU note_base * 5/9 ; 16 note_C5 EQU note_base * 1/2 ; 17 note_D5 EQU note_base * 4/9 ; 18 note_Eb5 EQU note_base * 5/12 ; 19 ; macro for dealing with a single channel mus_channel macro patdata, tonereg_lo, tonereg_hi, volreg, noise, envelope ; ; patdata = start of pattern data for this channel ; ; tonereg_lo = register number for low byte of tone ; ; tonereg_hi = register number for hi byte of tone ; ; volreg = register number for volume level ; ; noise = flag; whether noise parameters of samples in this channel should take effect ; ; envelope = flag; whether envelope settings should take effect in this channel local subnote_ctr, row_ctr, posn_ptr, no_pattern, pat_ptr, sam_ptr, no_note, tempo, no_row, note_idx, volume, decay, decayzero, pitchbend, noisefreq, pitchbend_adj, arpegg_pos, arpegg_mask, arpegg_ptr subnote_ctr: ld a,1 dec a jr nz,no_row ; ; read new row row_ctr: ld a,1 dec a jr nz,no_pattern ; ; read new pattern posn_ptr: ld hl,patdata push hl ld a,(hl) ; get new pattern address (low byte) ld (pat_ptr + 1),a ; write to pattern pointer inc h ld a,(hl) ; get new tempo ld (tempo + 1),a ; write to tempo resetter inc h ld a,(hl) ; get new sample sequence address (low byte) ld (sam_ptr + 1),a ; write to sample sequence pointer inc h ld a,(hl) ; get arpeggio address ld (arpegg_ptr + 1),a ; write to arpeggio pointer inc h if envelope ld a,0x0b ; write envelope speed lo byte ld bc,0xfffd out (c),a ld a,(hl) ld b,0xbf out (c),a endif inc h ld a,(hl) ; get new row count; will be written back at no_pattern pop hl inc l ld (posn_ptr + 1),hl no_pattern: ld (row_ctr + 1),a pat_ptr ld hl,pattern1 ; need to get hi byte right; only low byte is poked ld a,(hl) inc l ; will become inc hl if we overrun 256b ld (pat_ptr + 1),hl or a ; check if there's a non-zero note here jr z,no_note ld (note_idx + 1),a ; write note index ; ; read sample data and update sample params sam_ptr ld hl,sampseq ; need to get hi byte right; only low byte is poked ld a,(hl) inc l ; will become inc hl if we overrun 256b ld (sam_ptr + 1),hl ld l,a ld h,sampledat / 0x100 ld a,(hl) ; read attack val ld (volume + 1),a inc h ld a,(hl) ; read decay rate ld (decay + 1),a inc h ld a,(hl) ; read arpeggio mask ld (arpegg_mask + 1),a xor a ld (arpegg_pos + 1),a ; reset arpeggio position if noise ld (noisefreq + 1),a ; reset noise freq inc h ld a,(hl) ; read pitch bend ld (pitchbend_adj + 1),a ; write to pitchbend adjuster inc h ld bc,0xfffd ld a,7 out (c),a ; use mixer register ld a,(hl) ; read mixer value ld b,0xbf out (c),a ld hl,0 ld (pitchbend + 1),hl ; reset initial pitchbend endif no_note: tempo: ld a,0 no_row: ld (subnote_ctr + 1),a arpegg_pos ld a,0 push af srl a arpegg_ptr add a,0 ld l,a ld h,arpegg_seq / 256 ld a,(hl) note_idx: add a,0 ld l,a pop af inc a arpegg_mask and 0 ld (arpegg_pos + 1),a ld h,tb_tone_lo / 256 ld e,(hl) inc h ld d,(hl) if noise pitchbend ld hl,0 push hl add hl,de endif ld bc,0xfffd ld a,tonereg_lo out (c),a ld b,0xbf if noise out (c),l else out (c),e endif ld b,0xff inc a out (c),a ld b,0xbf if noise out (c),h else out (c),d endif ld b,0xff ; write to channel A volume (reg 8) ld a,volreg out (c),a volume ld a,32 decay sub 1 jr z,decayzero ; don't write volume back if it's reached zero ld (volume+1),a decayzero srl a ld b,0xbf out (c),a if noise ld b,0xff ld a,6 ; write to noise freq register out (c),a ld b,0xbf noisefreq ld a,0 out (c),a add a,4 ; increment noise period ld (noisefreq + 1),a pop hl pitchbend_adj ld bc,0 add hl,bc ld (pitchbend + 1),hl endif endm mus_init: ld bc,0xfffd ld a,7 ; set initial mixer value out (c),a ; (will be reset on first note to channel B) ld a,0x3c ld b,0xbf out (c),a ld a,0x0d ; set envelope shape ld b,0xff out (c),a ld a,0x0a ; use shape A (triangular wave) ld b,0xbf out (c),a ld a,0x0c ; set envelope speed hi byte ld b,0xff out (c),a xor a ; always 0 (highest speed) ld b,0xbf out (c),a ret mus_play: mus_channel patdata_a, 0, 1, 8, 0, 0 mus_channel patdata_b, 2, 3, 9, 1, 0 mus_channel patdata_c, 4, 5, 10, 0, 1 ret ; low bytes of values to output to AY pitch registers align 0x100 tb_tone_lo db 0 db note_F1 MOD 0x100, note_G1 MOD 0x100, note_Ab1 MOD 0x100, note_C2 MOD 0x100 db note_C3 MOD 0x100, note_F3 MOD 0x100, note_G3 MOD 0x100, note_Ab3 MOD 0x100 db note_A3 MOD 0x100 db note_Bb3 MOD 0x100, note_C4 MOD 0x100, note_D4 MOD 0x100, note_Eb4 MOD 0x100 db note_F4 MOD 0x100, note_G4 MOD 0x100, note_Bb4 MOD 0x100, note_C5 MOD 0x100 db note_D5 MOD 0x100, note_Eb5 MOD 0x100, note_C2 MOD 0x100 ; tb_tone_hi must be 0x100 bytes above tb_tone_lo pattern1 db 11,14,15,16,15,14,15,11,0,0,13,12,10,0,0,0 db 7,14,15,16,14,16,17,15,0,0,14,15,16,0,0,0 db 11,14,15 patt_endecho db 16,15,14,15,11,0,0,13,12,10,0,0,0 db 0,0,6,10,11 patt_ending db 10,11,6,7 silent db 0,0,0,0,0,0,0,0,0,0 pattern_drum db 5,0,0,5,5,0,0,5,0,10,5,0,5,8,5,0 pattern_fbass1 pattern_bass1 ; simple bass is just the first 1-4 notes of funkbass db 4,0,0,0,7,0,4,7,0,4,7,0,4,0,0,0 pattern_fbass2 pattern_bass2 db 3,0,0,0,7,0,3,7,0,3,7,0,3,0,0,0 pattern_fbass3 pattern_bass3 db 2,0,0,0,7,0,2,7,0,2,7,0,2,0,0,0 pattern_bass4 db 1 pattern_bridge db 11,13,14,15,11,13,14,15,11,13,14,15,11,13,14,15 db 11,13,14,16,11,13,14,16,11,13,14,16,11,13,14,16 db 11,14,15,16,11,14,15,16,11,14,15,16,11,14,15,16 db 11,14,15,17,11,14,15,17,11,14,15,17,11,14,15,17 ; high bytes of values to output to AY pitch registers align 0x100 tb_tone_hi db 0 db note_F1 / 0x100, note_G1 / 0x100, note_Ab1 / 0x100, note_C2 / 0x100 db note_C3 / 0x100, note_F3 / 0x100, note_G3 / 0x100, note_Ab3 / 0x100 db note_A3 / 0x100 db note_Bb3 / 0x100, note_C4 / 0x100, note_D4 / 0x100, note_Eb4 / 0x100 db note_F4 / 0x100, note_G4 / 0x100, note_Bb4 / 0x100, note_C5 / 0x100 db note_D5 / 0x100, note_Eb5 / 0x100, note_C2 ; sample sequence sampseq sampseq_melody ; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 sampseq_echo ; db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 ; db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 sampseq_drum db 3,3,4,3,3,3,4,3,3 sampseq_fbass sampseq_bass db 5,1,5,1,5,1,5 sampseq_off db 6 ; per-pattern data for channel a align 0x100 patdata_a ; note data start address, lo byte (assume it all fits in 256b for now) db pattern1 MOD 0x100 ; precalc melody db pattern1 MOD 0x100 ; intro melody db pattern1 MOD 0x100 ; main melody db pattern1 MOD 0x100 ; main melody db silent MOD 0x100 ; adjust for offset db pattern_bridge MOD 0x100, pattern_bridge MOD 0x100 db pattern_bridge MOD 0x100, pattern_bridge MOD 0x100 db (pattern1 + 5) MOD 0x100, pattern1 MOD 0x100 db patt_ending MOD 0x100 patdata_b db silent MOD 0x100 ; echo offset db pattern1 MOD 0x100 ; precalc melody echo db pattern1 MOD 0x100 ; intro melody echo db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 ; main drums db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 ; main drums db (pattern_bridge - 2) MOD 0x100, pattern_bridge MOD 0x100 db pattern_bridge MOD 0x100, pattern_bridge MOD 0x100 db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 ; main drums db pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100, pattern_drum MOD 0x100 db patt_endecho MOD 0x100, patt_ending MOD 0x100 patdata_c db silent MOD 0x100 ; lead-in / precalc silence db pattern_bass1 MOD 0x100, pattern_bass2 MOD 0x100, pattern_bass3 MOD 0x100, pattern_bass1 MOD 0x100 ; plain bass for intro db pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 ; funk bass for main db pattern_fbass2 MOD 0x100, pattern_fbass3 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 db pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 ; funk bass for main db pattern_fbass2 MOD 0x100, pattern_fbass3 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 db pattern_bass1 MOD 0x100, pattern_bass2 MOD 0x100, pattern_bass4 MOD 0x100, pattern_bass1 MOD 0x100 ; plain bass for bridge db pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 ; funk bass for bridge development db pattern_fbass2 MOD 0x100, pattern_fbass3 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 db pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 ; funk bass for main db pattern_fbass2 MOD 0x100, pattern_fbass3 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 db pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100, pattern_fbass1 MOD 0x100 ; funk bass for main db pattern_fbass2 MOD 0x100, pattern_fbass3 MOD 0x100 db pattern_bass1 MOD 0x100 db pattern_bass1 MOD 0x100 ; off align 0x100 ; tempo db 12, 12, 12, 12 db 12, 6, 6, 6, 6 db 12, 12, 36 db 12, 12, 12 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6 db 12, 36 db 207 db 96, 96, 96, 96 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6, 6, 6, 6, 6 db 96, 96, 96, 96 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6, 6, 6, 6, 6 db 6, 6, 6, 6, 6, 6 db 96 db 96 ; off align 0x100 ; sampleseq pointers db sampseq_melody MOD 0x100, sampseq_melody MOD 0x100, sampseq_melody MOD 0x100, sampseq_melody MOD 0x100 db sampseq_melody MOD 0x100, sampseq_melody MOD 0x100, sampseq_melody MOD 0x100, sampseq_melody MOD 0x100, sampseq_melody MOD 0x100 db (sampseq_melody + 5) MOD 0x100, sampseq_melody MOD 0x100 db sampseq_melody MOD 0x100 db sampseq_echo MOD 0x100, sampseq_echo MOD 0x100, sampseq_echo MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_echo MOD 0x100, sampseq_echo MOD 0x100 db sampseq_echo MOD 0x100, sampseq_echo MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100, sampseq_drum MOD 0x100 db sampseq_echo MOD 0x100, sampseq_echo MOD 0x100 db sampseq_bass MOD 0x100 db sampseq_bass MOD 0x100, sampseq_bass MOD 0x100, sampseq_bass MOD 0x100, sampseq_bass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_bass MOD 0x100, sampseq_bass MOD 0x100, sampseq_bass MOD 0x100, sampseq_bass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_fbass MOD 0x100, sampseq_fbass MOD 0x100 db sampseq_bass MOD 0x100 db sampseq_off MOD 0x100 ; arpeggio pointers align 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq3 MOD 0x100, arpegg_seq4 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq3 MOD 0x100, arpegg_seq4 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq3 MOD 0x100, arpegg_seq4 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq3 MOD 0x100, arpegg_seq4 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100, arpegg_seq MOD 0x100, arpegg_seq2 MOD 0x100 db arpegg_seq3 MOD 0x100, arpegg_seq4 MOD 0x100 db arpegg_seq MOD 0x100 db arpegg_seq MOD 0x100 align 0x100 ; envelope speeds db 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0 db 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0 db 0, 0 db 0x3f db 0x3f, 0x4f, 0x53, 0x3f db 0x3f, 0x3f, 0x3f, 0x3f db 0x4f, 0x53, 0x3f, 0x3f db 0x3f, 0x3f, 0x3f, 0x3f db 0x4f, 0x53, 0x3f, 0x3f db 0x3f, 0x4f, 0x5d, 0x3f db 0x3f, 0x3f, 0x3f, 0x3f db 0x4f, 0x53, 0x3f, 0x3f db 0x3f, 0x3f, 0x3f, 0x3f db 0x4f, 0x53, 0x3f, 0x3f db 0x3f, 0x3f, 0x3f, 0x3f db 0x4f, 0x53 db 0x3f db 0 align 0x100 ; row count db 64, 64, 64, 64 db 5, 64, 64, 64, 64 db 59, 53, 12 db 2, 64, 67 db 16, 16, 16, 16, 16, 16, 16, 16 db 16, 16, 16, 16, 16, 16, 16, 16 db 66, 64, 64, 62 db 16, 16, 16, 16, 16, 16, 16, 16 db 16, 16, 16, 16 db 18, 12 db 4 db 4, 1, 1, 2 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16, 16, 16 db 4, 1, 1, 2 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16, 16, 16 db 16, 16 db 2 db 1 align 0x100 ;sample data ; attack values sampledat db 32, 30, 24, 30, 32, 32 ; arpeggio sequence arpegg_seq db 0,3,5,6 arpegg_seq2 db 0,2,4,7 arpegg_seq3 db 0,1,4,6 arpegg_seq4 db 0,3,5,7 align 0x100 ; decay rates db 1, 1, 1, 6, 2, 0 align 0x100 ; arpeggio mask db 0xfe, 0xf7, 0xfe, 0xfe, 0xfe, 0xfe align 0x100 ; pitch bend db 0, 0, 0, 128, 0, 0 align 0x100 ; mixer setting db 0x38, 0x38, 0x38, 0x38, 0x2a, 0x38