It is currently Mon Jun 17, 2019 2:17 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu May 23, 2019 6:24 am 
Offline

Joined: Tue Feb 27, 2018 10:41 am
Posts: 43
Location: Brazil
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.


Top
 Profile  
 
PostPosted: Thu May 23, 2019 8:09 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2521
Location: DIGDUG
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

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Thu May 23, 2019 2:58 pm 
Offline

Joined: Tue Feb 27, 2018 10:41 am
Posts: 43
Location: Brazil
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group