DCPM samples with FamiTone

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

DCPM samples with FamiTone

Post by DRW »

I got my game to work with FamiTone. It plays some example music and sound effects.

Now I wanted to try digital samples.

I have the after_the_rain.dmc binary file that includes some sample sounds. I know that I have to call FamiToneSamplePlay with a certain number in the A register that stands for the desired sample sound.

But what do I have to do with the samples themselves? It's a binary file, so I guess I'll have to .incbin it somewhere in RODATA. But then what? How does FamiTone know where to look for the sample?
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: DCPM samples with FamiTone

Post by rainwarrior »

The DMC file is made by the text2data utility. Put the samples in your music FTM before exporting, and they'll end up in there, I think?

Then just include the DMC file at FT_DPCM_OFF like in the example.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: DCPM samples with FamiTone

Post by DRW »

Oh, right. Thanks.

When I look at that value FT_DPCM_OFF, I always think it has something to do with disabling the DPCM channel instead of it being an offset value.

But it works now.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Post Reply