It is currently Sun Jan 21, 2018 10:02 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Dec 02, 2017 5:28 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2504
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
 Profile  
 
PostPosted: Sat Dec 02, 2017 5:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19492
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
 Profile  
 
PostPosted: Sat Dec 02, 2017 6:05 pm 
Offline

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


Top
 Profile  
 
PostPosted: Sat Dec 02, 2017 6:24 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19492
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
 Profile  
 
PostPosted: Sat Dec 09, 2017 9:17 am 
Offline

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
 Profile  
 
PostPosted: Sat Dec 09, 2017 9:39 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19492
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
 Profile  
 
PostPosted: Sat Dec 09, 2017 2:28 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2504
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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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 6 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group