Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > Interesting NSF bug I found. Owner: Xiphos2000 New post
Page 1 of 2 Sort: Goto Page: [1] [2] Next >>
Interesting NSF bug I found. Posted: 2015-01-11 04:06  (Last Edited: 2015-01-11 23:32) Reply | Quote
Xiphos2000

Avatar

Member for: 2830 days
Location: Washington
Status: Offline

#64836
I was listening to this soundtrack that I was making to see if I made any mistakes. And this happened: [url=https://www.youtube.com/watch?v=wyJpHTM3pJ4]https://www.youtube.com/watch?v=wyJpHTM3pJ4
The reason for this was that the song I was listening to had 7 frames, and I wanted the last one to repeat over and over again. However, I had accidentally put down "B08" instead of "B07" which made the song skip to a frame that didn't exist. So instead of just looping to the nearest frame like FT did, the NSF file totally broke down :P
On the bright side, I managed to rip these samples. Most of them are just garbled junk of screeches you would find in an H.R.Giger film, but one could be used for a sawtooth bass (like in The Immortal.)

_______________________
I am everywhere. I am nowhere. I am everyone. I am no one. I am Darkman.
...No wait, that's not how it goes.
Attachments:
wtf_samples.rar (4 Kb)
Posted: 2015-01-11 09:41 Reply | Quote
za909

Avatar

Member for: 3963 days
Location: Hungary
Status: Offline

#64837
It's always worth trying to target game code with the DPCM unit, you might find some usable sounds actually! (I found this scratch noise in Megaman 3, and thought it could be used here and there)


_______________________
Rectangular sh*t ©
Attachments:
password.nsf (8 Kb)
Posted: 2015-01-11 19:01 Reply | Quote
modusponens

Avatar

Member for: 4743 days
Location: Redmond, WA
Status: Offline

#64841
Xiphos, you should run that NSF through rainwarrior's NSF importer! It would be really cool to see how some of those sounds got "made," especially at around 1:02 and 1:06, and to see what's going on at 1:52.

Posted: 2015-01-11 22:11 Reply | Quote
tadpole

Avatar

Member for: 5713 days
Location: Renton, WA, USA
Status: Offline

#64848
That song is cool

Posted: 2015-01-11 22:32 Reply | Quote
jfbillingsley

Avatar

Member for: 2770 days
Status: Offline

#64849
How the hell did you pan? (or is that just the NSF player's mixer doing that)

Posted: 2015-01-11 23:40 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#64851
These samples are part of the driver program data and I think some pattern data. You can try to make samples of any data and get similar results, just try to load any file as a DPCM sample.

_______________________
Programmer and developer
Posted: 2015-01-12 00:56 Reply | Quote
Xiphos2000

Avatar

Member for: 2830 days
Location: Washington
Status: Offline

#64853
@modus I don't have the NSF file anymore, but I can try to re-create it. I'll try that immediately. However, I'm having trouble with getting the same effect. Ugh
@tadpole thanks!
@jbilling What do you mean by pan? Just wondering.
@jsr That's cool! I should try that sometime.

Posted: 2015-01-12 01:05 Reply | Quote
Xiphos2000

Avatar

Member for: 2830 days
Location: Washington
Status: Offline

#64854
I found out what was going on with those samples. They were being played at random low pitches. And the thing that was going on at 1:52 was a looping sample. What it really is is just a small little "du-" as I like to call it, being looped continuously.

Posted: 2015-01-12 01:21  (Last Edited: 2015-01-12 01:23) Reply | Quote
jfbillingsley

Avatar

Member for: 2770 days
Status: Offline

#64855
Panning, fading the sound between the left and right channels in stereo. Like at the beginning where it alternates between left and right. The NES only has mono output...

Posted: 2015-01-12 01:32 Reply | Quote
Xiphos2000

Avatar

Member for: 2830 days
Location: Washington
Status: Offline

#64856
That's the NSF player working. I actually created that effect to create an echo sound (I also did it with one channel, which is only done when only one out of 2 square channels are available.) It creates a very different sound when played through NSF.

Posted: 2015-01-12 01:54 Reply | Quote
jfbillingsley

Avatar

Member for: 2770 days
Status: Offline

#64858
Ohh, okay!

Posted: 2015-01-13 17:25 Reply | Quote
B00daW

Avatar

Member for: 4986 days
Status: Offline

#64880
The behavior that you're experiencing is the DPCM wrap-around glitch that happens when the DMC register reads past $FFFF on a 32K ROM bank; and then wraps back around to the start of ROM space: $8000.

http://wiki.nesdev.com/w/index.php/APU_DMC#Memory_reader

Normally the space for DPCM is $C000-$FFFF, you can either intentionally or unintentionally start to play code or data in other previously unreachable areas this way.

I'm not certain how the FamiTracker bankswitching code or DPCM sample loading code usually works but theoretically you could use a 16K "silent" DPCM sample and perhaps add a byte at the end of it and use Yxx commands to see if you could flip the read back over to $8000 to achieve the glitch.

If anybody wants to try, I'd be curious to the results. Also you could try a previous version of FamiTracker without DPCM bankswitching enabled.

Posted: 2015-01-13 21:24 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#64881
It could wrap-around, but that only happens at the end of the last sample. It's more likely that a page from the driver area was swapped in into the sample area instead, since the page number is stored along with the sample address. Both might be "random" when undefined pattern data is being read.

_______________________
Programmer and developer
Posted: 2015-01-13 21:51 Reply | Quote
Xiphos2000

Avatar

Member for: 2830 days
Location: Washington
Status: Offline

#64882
Interesting. I do have a few questions, though: What exactly causes DMC registers to read what they do? Such as like (I'm pulling this number right out of my butt, BTW) $F164? And is this number any different for 7-bit DPCM? This sort of thing is actually pretty interesting.

Posted: 2015-01-13 22:39  (Last Edited: 2015-01-15 01:53) Reply | Quote
B00daW

Avatar

Member for: 4986 days
Status: Offline

#64885
Well, the 2a03 $4011 7-bit PCM DAC only does write streaming, unlike the MMC5 8-bit PCM DAC that also does read-streaming. So you supplying an "address" to $4011 like $F164 would likely just stream those two bytes; sounding like hardly anything.

Also there is no such thing as 7-bit DPCM. DPCM is 1-bit encoded data that either tells the DAC to move up or down, but can never flatline. You are thinking of 7-bit PCM. Take the Zxx command for instance. This does direct writes of bytes to $4011. The max values to write are $00 through $7F; bits 0 through 6 of the register. This plays your 7-bit PCM samples. FamiTracker can only do $4011 PCM with very fast sequencer tick speeds. "Pitches" could be achieved by x of the Fxy command.

http://wiki.nesdev.com/w/index.php/APU_DMC#Output_unit

$4012 loads a DPCM sample address, like $F164. $4013 says how long it is. And $4010 tells what speed (frequency/pitch) it should play it at.

I swear someone told me that bit 7 of $4011 is for the delta decoding for DPCM and cannot be written to or read. Not finding corroborating evidence of it at the moment.

http://wiki.nesdev.com/w/index.php/APU#DMC_.28.244010-4013.29

Page 1 of 2 Sort: Goto Page: [1] [2] Next >>