It is currently Mon Oct 15, 2018 7:37 am

 All times are UTC - 7 hours

 Page 2 of 2 [ 22 posts ] Go to page Previous  1, 2
 Print view Previous topic | Next topic
Author Message
 Posted: Sat Dec 02, 2017 5:28 pm

Joined: Wed May 19, 2010 6:12 pm
Posts: 2757
On the other hand, it would be faster if the SPC700 generated square waves by decrementing a register by a certain amount until it went negative, then add another value back to the negative number and updated the sample for the channel. It would be unpredictable how much CPU it will take, so it should draw it to a BRR sample.

Last edited by psycopathicteen on Sat Dec 02, 2017 5:49 pm, edited 1 time in total.

Top

 Posted: Sat Dec 02, 2017 5:39 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
You could probably get away with mip-mapping them. Pre-generate a bunch of BRR waveforms of the form 7666...66679AAA...AAA9 and filter 0, one for each combination of octave and duty. (The 7 and 9 are pre-emphasis to fool the Gaussian interpolation into behaving more like cubic spline interpolation.) Then switch each channel's loop point among them based on the octave and duty in effect at any given time. This would cause a "phase reset" of sorts when crossing octaves, but the 2A03 APU has those anyway.

Top

 Posted: Sat Dec 02, 2017 6:05 pm

Joined: Wed May 19, 2010 6:12 pm
Posts: 2757
It's a matter on memory vs speed. Though using "speed" method you'll get an extra crispy square wave.

Top

 Posted: Sat Dec 02, 2017 6:24 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
But you've got plenty of memory on hand. Generate square waves of lengths 16, 32, 64, 128, 256, and 512 for the three audibly distinct duty cycles the NES APU can produce, for a total of 1008 samples or 1008 * 9/16 = 567 bytes per channel. Round that up to 768 to account for padding consideration when switching among waveforms, and you're still only up to 2.25 KiB out of the 64 KiB that the APU has. Then have the player tweak each pulse channel's loop point to switch among them.

Top

 Posted: Sat Dec 09, 2017 9:17 am

Joined: Fri Nov 24, 2017 7:03 am
Posts: 17
Doesn't the faux retro jingle from the intro of Donkey Kong Country bypass the filtering somehow and preserve the aliased sound of the triangle?

Top

 Posted: Sat Dec 09, 2017 9:39 am

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
lazygecko wrote:
Doesn't the faux retro jingle from the intro of Donkey Kong Country bypass the filtering

No. I just put my DKC cartridge in my Super NES, listened to the first six measures of the intro, and couldn't hear the telltale 31st and 33rd harmonics, which are supposed to be in the 4K-8K band for the notes being played. It's also unrealistic in that the triangle channel has smooth volume control.

Top

 Posted: Sat Dec 09, 2017 2:28 pm

Joined: Wed May 19, 2010 6:12 pm
Posts: 2757
I thought of a way to do it through software. Calculate the slope of the output for each channel combined, and then recursively add the output of the previous sample.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 2 of 2 [ 22 posts ] Go to page Previous  1, 2

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: No registered users and 5 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki