Making music from the NES and Gameboy's extra channel

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Making music from the NES and Gameboy's extra channel
by on (#47048)
So... first of all, I'm sorry that I just come in here out of nowhere and ask questions... but yes, I do like this forum a lot, been lurking, etc...

Anyhow... I've been interested in creating NES and Gameboy-like music in FL Studio.

I've been interested in the extra channels of the NES (like in the N106 or FDS channel) and the fourth Gameboy sound channel, the channels that accept waves that change in amplitude and frequency... I've used nsfplay to view the raw wave data for the NES, and for the Gameboy, I've viewed the RAM in FF30-FF3F to view the raw wave data.

After writing the bytes to a file with a hex editor (doubling the 8 bit samples to 16 bit samples), and importing the data to Audacity as unsigned PCM, saving the resulting wav, and importing it into FL Studio, it sounds... similar, yet kind of horrible and grating.

I am wondering... Considering that the NES and Gameboy use those exact waves, how does it make them sound... well, good? Is it a low-pass thing?

by on (#47053)
You need to double 4-bit samples to 8-bit samples, not 8-bit to 16-bit. Game Boy samples are 4-bit, with the high-order nibble played first and the low-order nibble played second. For example, 01 23 45 67 in the wave memory would go into a .wav file as 00 11 22 33 44 55 66 77. Another thing is that they're unsigned; 8 is the center line, not 0.

Try it with 01 23 45 67 89 AB CD EF FE DC BA 98 76 54 32 10; that should sound just like the NES triangle wave.

by on (#47055)
tepples wrote:
You need to double 4-bit samples to 8-bit samples, not 8-bit to 16-bit...


Oops... Yes, I meant to say that I doubled the 4 bit to 8 bit, doubling them as you said...

I think I figured out the problem, though. I think I've been stupidly importing them as 16 bit all along for some reason :( After making double sure that I was importing it as 8 bit unsigned, and trying to reproduce songs with that wave, the songs turned out more or less perfectly.

Well... what a stupid oversight. Thanks, though :) I'm going to keep trying, though, to apply filters to make it more authentic sounding...