DCPM samples with FamiTone

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

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

DCPM samples with FamiTone

Post by DRW » Thu Oct 29, 2015 3:06 pm

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?
Available now: My game "City Trouble".
Sales website: https://megacatstudios.com/products/city-trouble
Gameplay: https://youtu.be/Eee0yurkIW4
Download website: http://www.denny-r-walter.de/city.htm

User avatar
rainwarrior
Posts: 7741
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: DCPM samples with FamiTone

Post by rainwarrior » Thu Oct 29, 2015 3:36 pm

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: 1918
Joined: Sat Sep 07, 2013 2:59 pm

Re: DCPM samples with FamiTone

Post by DRW » Fri Oct 30, 2015 2:13 am

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.
Available now: My game "City Trouble".
Sales website: https://megacatstudios.com/products/city-trouble
Gameplay: https://youtu.be/Eee0yurkIW4
Download website: http://www.denny-r-walter.de/city.htm

Post Reply