Using steady DPCM samples as a 'lead'

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

Moderator: Moderators

lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Using steady DPCM samples as a 'lead'

Post by lidnariq »

The controller port is 3 general-purpose inputs, 1 general-purpose output, 2 pins to power things, and 1 pin that indicates when the NES is reading from the controller port.
It'd be pretty easy to make a "null modem" cable that would connect two NESes together to communicate, although it would be hard to communicate in a manner that was both high bandwidth and allowed anything else to go on at the same time.
User avatar
OneCrudeDude
Posts: 276
Joined: Fri Aug 23, 2013 2:14 am

Re: Using steady DPCM samples as a 'lead'

Post by OneCrudeDude »

Hypothetically speaking, how could one make an "NES LAN kit", if at all possible? Perhaps by linking the consoles together by the cartridge slot, or the expansion port, or both?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Using steady DPCM samples as a 'lead'

Post by lidnariq »

If I were to deign something arbitrarily, I'd probably make something like what the Vs. DualSystem does—basically the highest possible bandwidth for a plain 6502 design without a general purpose data transfer unit (which the NES doesn't have).

The Vs. DualSystem provides 2 KiB of memory that the two CPUs can swap back and forth, with a simple REQ/ACK locking behavior (much like on an old parallel port printer). Anything else would be rather CPU intensive, either involving lots of polling or flurries of interrupts.

In any case, the expansion port of the NES doesn't really provide particularly useful signals; anything that used it would have to also provide a cartridge... and at that point, you may as well put the hardware on a cartridge.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Using steady DPCM samples as a 'lead'

Post by Memblers »

Controller port could be fairly decent (and relatively easy to build), with an MCU handling bit-banged (or possibly hardware-based) synchronous communication between a couple systems. Using D3 or D4 as a 'ready' signal would reduce the need for polling, NES could check once per frame and read it out of the MCU's buffer if the data is ready. I've been working on something similar, but more intended for NES to PC communication.

MCUs with ethernet capability are really cheap too, if one really wanted an NES LAN. :) Would be cool, but it seems like the opportunities to use it would be few and far between.
User avatar
OneCrudeDude
Posts: 276
Joined: Fri Aug 23, 2013 2:14 am

Re: Using steady DPCM samples as a 'lead'

Post by OneCrudeDude »

Apologies for a bump of an old thread, but I had a question. I was recently playing the second generation of Pokemon games (Gold/Silver/Crystal), and I was wondering if it would be possible to recreate on the NES. More specifically, what if Pokemon was an NES game, but the programmers still wanted to trade and battle their Pokemon? Would it be possible to create a link system between cartridges? What about someone making an NES version of Pokemon, would it be possible to 'trade' Pokemon with the Game Boy games?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Using steady DPCM samples as a 'lead'

Post by tepples »

The wire protocol for NES and Super NES controllers is very similar to the Game Link protocol, except the NES is always the "master" in SPI terms. So yes, NES to Game Boy is probably possible. If I had a flash card for an 8-bit Game Boy, I'd probably already have made a music demo that uses the Game Boy as four extra sound channels.
User avatar
OneCrudeDude
Posts: 276
Joined: Fri Aug 23, 2013 2:14 am

Re: Using steady DPCM samples as a 'lead'

Post by OneCrudeDude »

That's interesting. Most development stuff is born out of curiosity, in this case if it's entirely possible for an unofficial Pokemon game on the NES being able to give and receive Pokemon to the GameBoy games. What the games really do is simply delete the Pokemon from one end and copy it to the next end, so it probably would be possible to do. If I was technically competent, I'd do so much.
User avatar
RushJet1
Posts: 155
Joined: Wed Nov 10, 2004 10:17 pm
Contact:

Re: Using steady DPCM samples as a 'lead'

Post by RushJet1 »

Another bump! Surprised nobody mentioned Strobe: http://battleofthebits.org/arena/Entry/Ziberia/3564/

If you want crazy DPCM usage he's your man!
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Using steady DPCM samples as a 'lead'

Post by tepples »

I wonder how something that could be used in a game. The comments on that NSF say it's too big for the PowerPak, whose NSF player is limited to about 200-some KiB, which is just less than one-fourth of NSF's theoretical limit of 1 MiB. So in a practical case, big DPCM samples like that might have to be streamed into RAM during playback from some sort of separate memory on the cart. I wonder how well this would work with the oft-repeated FDS-style idea to store bulk data in SPI flash and stream it into RAM at $C000-$DFFF, as most recently reiterated by infiniteneslives. It would depend on how the SPI flash is implemented. The player has to provide a byte to the DMC every 432 cycles (or 400 on PAL NES) while moving sprites around. An SPI host that relies on the CPU to move a bit at a time, like the existing interface at $4016/$4017, would be unlikely to sustain the required 33 kbps data rate while giving much margin for game logic. It'd probably take a CPLD that uses M2 to clock the flash eight times in a row and then provides all 8 bits on the data bus. This would let the program get in after vblank, grab 69 or so bytes and stash them in RAM, and get out.
User avatar
RushJet1
Posts: 155
Joined: Wed Nov 10, 2004 10:17 pm
Contact:

Re: Using steady DPCM samples as a 'lead'

Post by RushJet1 »

Another good one that is significantly smaller https://www.youtube.com/watch?v=ZQtGUe55MsA
User avatar
OneCrudeDude
Posts: 276
Joined: Fri Aug 23, 2013 2:14 am

Re: Using steady DPCM samples as a 'lead'

Post by OneCrudeDude »

Impressive, but I think Strobe's song is ultimately very messy; it doesn't have much musical quality to it, and then tries to become unmelodious EDM music. That said, I reckon that a DPCM heavy song would play either during the credits (when there's nothing to really push around), or for the soundtrack to be made for a game rather devoid of any action, such as a puzzle game.

At last I truly see, the NES' artifacting is too severe to be used for anything more than short drum beats. However, I love how low-fi and detuned Sunsoft's (and other companies) basslines sound, so I'm conflicted.
Tempo Quill
Posts: 1
Joined: Mon May 15, 2023 5:33 pm

Re: Using steady DPCM samples as a 'lead'

Post by Tempo Quill »

I know this post has been dead for a while, but I decided to take a whack at making a four-octave DPCM keyboard. To get the best quality/tuning, I stuck to pitches 11, 14, and 15. While dev'ing, I kept track of where in the $c000-$ffff area I put the samples according to the 64-byte blocks. To keep the samples tame and consistent, a balancing act between phase and sample count was achieved. With all 33 .dmc files, I was well able to keep the DPCM area under 12K.

Specifications:
Source - Audacity sawtooth generator, online freq. table: https://pages.mtu.edu/~suits/notefreqs.html
Technique - Copy-paste, duplicate reversal, duplicate inversion, crossfading
Base rate - 33143 hz
Base sample count - 8
Sample incrementation - 128
Sample Block Incrementation - 512
Key Range - D#3 - B5 (pitch 15, 33 files)
Post Reply