Switching DMC samples mid-song

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
GARY 'M 9
Posts: 3
Joined: Wed Sep 28, 2011 7:08 pm

Switching DMC samples mid-song

Post by GARY 'M 9 »

I'm currently trying to track something in famitracker, but it seems what I'm trying to do isn't possible with traditional .nsf by itself.

I need to be able to switch DPCM samples (of 4081 bytes) after they've been played because I've hit the (according to famitracker) 16KB limit for samples.

Would it be possible to replace samples on they fly (One second/ 50 or 60 frames depending) while still playing the song?

If this matters, I've estimated the entirety of the song when it's finished to be about 681KB. I know the max official PRG-ROM was 512KB, so would this be able to be made without some weird custom mapper?
Last edited by GARY 'M 9 on Fri Sep 30, 2011 9:12 pm, edited 1 time in total.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

That's a limitation of Famitracker's design and programming. If you wanted a LOT of samples, you could go as high as 512k with MMC3. But there's no ready-made sound engine and player for this.

Maybe reduce the quality of the samples to get them to fit.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
cak
Posts: 34
Joined: Mon Jun 28, 2010 8:35 pm
Location: oregon

Post by cak »

http://famitracker.shoodot.net/forum/posts.php?id=2164

Didn't read the whole thread, but I think the basic gist is that you can have unlimited samples by saving each 16k of samples as an instrument, then loading the instruments in a new song. Don't know if the ftm can be compiled as an nsf, however. Also, I think this trick was eliminated in latest version 3.7.

Another option is PPMCK, which has unlimited (?) bank-switching.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

Pornotracker also doesn't have a 16KB limit for DPCM samples.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
GARY 'M 9
Posts: 3
Joined: Wed Sep 28, 2011 7:08 pm

Post by GARY 'M 9 »

Dwedit wrote:That's a limitation of Famitracker's design and programming. If you wanted a LOT of samples, you could go as high as 512k with MMC3. But there's no ready-made sound engine and player for this.

Maybe reduce the quality of the samples to get them to fit.
Why use MMC3? MMC5 allows for 1MB, which is in the range that I need.

Reducing the quality of the samples isn't an option for me with this. I'll explain at the end of this post.
cak wrote:http://famitracker.shoodot.net/forum/posts.php?id=2164

Didn't read the whole thread, but I think the basic gist is that you can have unlimited samples by saving each 16k of samples as an instrument, then loading the instruments in a new song. Don't know if the ftm can be compiled as an nsf, however. Also, I think this trick was eliminated in latest version 3.7.

Another option is PPMCK, which has unlimited (?) bank-switching.
That "trick" was in-tracker only, when compiled it cut sample length from the .NSF. It was more of a bug.

Also, PPMCK's download link is gone...
thefox wrote:Pornotracker also doesn't have a 16KB limit for DPCM samples.
Correct me if I'm wrong, but the limit of DPCM samples is only $0F? I'm going to need ~$AC samples. I also can't seem to find the note that would make the samples sound normal.

------------------------

Ok, what I'm trying to do is either do a raw port of a normal song that is 2m:51s and play it in the DPCM and add some sound channel accompanies, or remix the song in an editing program a bit, port it to DPCM samples and then add 8-bit parts to it. The quality I've been able to achieve with famitracker's import option is that of vinyl records.

I need to be able to make this all play on an NES normally, not just through a tracker program so I'm probably going to have to bankswitch the 4-second song clips together through some programming, unless there's a better option.

Here's the test .nsf I made just to show kinda what I'm doing:

http://api.ge.tt/0/8tnziD8/0/blob/download

(Play that in an accurate emulator like fceux, things like faulty WinAMP plugins and emulators like Jnes just don't cut it. The samples are quiet for a reason, so turn your speakers up to hear it clearer.)
cak
Posts: 34
Joined: Mon Jun 28, 2010 8:35 pm
Location: oregon

Post by cak »

GARY 'M 9
Posts: 3
Joined: Wed Sep 28, 2011 7:08 pm

Post by GARY 'M 9 »

cak wrote:
GARY 'M 9 wrote:Also, PPMCK's download link is gone...
http://nesdev.com/bbs/viewtopic.php?t=4296
http://www.mmlshare.com/forums/topic/4d ... 7228000000
Thanks!
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

GARY 'M 9 wrote:
thefox wrote:Pornotracker also doesn't have a 16KB limit for DPCM samples.
Correct me if I'm wrong, but the limit of DPCM samples is only $0F? I'm going to need ~$AC samples. I also can't seem to find the note that would make the samples sound normal.
Nope, you can have up to 255 instruments. I assume you're using the highest frequency, so to make them sound normal enter a note "-F-" (with key 7 in the default octave).
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

GARY 'M 9 wrote:MMC5
Few emulators support MMC5 thoroughly. Even a PowerPak doesn't. And unlike with MMC3, there aren't MMC5 clone ICs available from various sources.
Correct me if I'm wrong, but the limit of DPCM samples is only $0F? I'm going to need ~$AC samples.
By "limit" what do you mean? I'm not familiar with particular trackers, so I'll talk about the NES itself:
Length: The DMC sample length register is $00 through $FF, where the actual length of the waveform is 16*L+1 bytes or 128*L+1 samples.
Number of samples: Samples can start on any in $C000-$FFFF. With MMC3, FME-7, MMC5, or the NSF mapper, you'll usually be switching waveforms into $C000-$DFFF.
I also can't seem to find the note that would make the samples sound normal.
What notes do you need? If you have a waveform of a sampled instrument, and you resample it to C = 16744 Hz, the NES can play it back at these pitches:
Octave 1: C, D, E, F, G, A, B
Octave 2: C, D, F, G, A
Octave 3: C, E, G
Octave 4: C
I need to be able to make this all play on an NES normally, not just through a tracker program so I'm probably going to have to bankswitch the 4-second song clips together through some programming
That's pretty much how you have to do it. Resample the whole thing to 33144 Hz, and play 32648-sample chunks of the waveform at $C000 and $D000. In this case, IRQ might be helpful to get perfectly gapless playback.
User avatar
B00daW
Posts: 586
Joined: Thu Jan 03, 2008 1:48 pm

Post by B00daW »

Here's an example that Strobe did a long time ago making use of the DPCM channel to simulate multiple channels using a few custom samples and the sample offset command.

http://lmao.rotfl.at/upload/Str0be/Stuffness.zip
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 521
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Post by Jarhmander »

tepples wrote:
I also can't seem to find the note that would make the samples sound normal.
What notes do you need? If you have a waveform of a sampled instrument, and you resample it to C = 16744 Hz, the NES can play it back at these pitches:
Octave 1: C, D, E, F, G, A, B
Octave 2: C, D, F, G, A
Octave 3: C, E, G
Octave 4: C
Beware however that these pitches obtained aren't perfect pitched as despicted by my good ol' table of DPCM frequency/note : http://www.2a03.org/forum/viewtopic.php?id=924. With high-pitched notes it can get quite dissonant with the rest of the music.
Post Reply