Is it possible to change the famitone code in order to control the speed and/or pitch of a DPCM sample?
The idea is to pass the speed and/or pitch in registers X/Y as parameters of the subroutine FamiToneSamplePlay.
Thanks in advance.
DPCM doesn't have a pitch adjustment. It does have a sample rate adjustment (which affects pitch).
If you want specific pitches, you probably need a separate sample for each pitch.
Famitone usually loads from a table called "samples"
You could make the rate a variable. Instead of
FamiToneSamplePlay:
...
lda (FT_TEMP_PTR),y ;pitch and loop
sta APU_DMC_FREQ
have
lda variable
sta APU_DMC_FREQ
Works like a charm!
The value on the table 'samples' generated by text2data for frequency and loop is at high value for frequency ($0f) so I could only low the frequency...below $0d the audio becomes just noise...but works anyway.
Thank you so much for the help.