It is currently Sun Oct 22, 2017 9:35 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Feb 23, 2013 10:24 pm 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
Hello!!

I would like to introduce "Peace Synthesizer Framework"
It support NES/Famicom sound emulation with customizable Visualization and DSP


#Demo


Vampire Killer - Castlevania #NES Stereolization process in "Peace Audio Synthesizer"

http://www.youtube.com/watch?v=1YqyFx5VKf4



Thanks!!
-------------------------------------------------------------------
http://peacedeveloper.appspot.com/

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 2:40 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Please use something like blipbuf for audio synthesis if possible.


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 5:57 pm 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
May i ask why blipbuf ?

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 6:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
BLEP (band-limited step) resampling, the technique used by blip-buf, is a way to eliminate aliasing from a signal when downsampling from the 1.79 MHz CPU frequency to 44100 or 48000 or whatever target frequency. It works by decomposing a signal into a sum of Heaviside steps, low-pass filtering a single representative step, sampling that filtered step at various fractions of an output sample, and adding up all the steps. For example, a square wave at 250 Hz has 500 steps per second: 250 rises and 250 falls.


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 8:10 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Why use something like blipbuf? Because otherwise the sound has a scratchy quality (due to aliasing) which pollutes the crystal-clear sound of the NES. This was evident in the recording you posted. I just wanted to bring it to your attention.


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 8:21 pm 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
tepples wrote:
BLEP (band-limited step) resampling, the technique used by blip-buf, is a way to eliminate aliasing from a signal when downsampling from the 1.79 MHz CPU frequency to 44100 or 48000 or whatever target frequency. It works by decomposing a signal into a sum of Heaviside steps, low-pass filtering a single representative step, sampling that filtered step at various fractions of an output sample, and adding up all the steps. For example, a square wave at 250 Hz has 500 steps per second: 250 rises and 250 falls.


Thank you very much
This is something very useful

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 10:23 pm 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
blargg wrote:
Why use something like blipbuf? Because otherwise the sound has a scratchy quality (due to aliasing) which pollutes the crystal-clear sound of the NES. This was evident in the recording you posted. I just wanted to bring it to your attention.


Are there any proof of audible alias which generate by sampling in 44100 hz?
I see when visualize or analyse them I can found it easily.
However by hearing as for me it not much different.

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Sun Feb 24, 2013 10:50 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3944
The NES is actually generating audio at ~1.79MHz (that's megahertz, not kilohertz). Any other sample rate will be a resampled version of that.
If you use nearest-neighbor resampling, it sounds awful. Using linear interpolation doesn't sound too bad, but is still somewhat distorted. Bandlimited interpolation (what Blargg is doing) works best.
Blip-buffer also uses a clever programming trick to make the sound synthesis run really fast, it stores the wave as volume differences instead of volume levels, then converts back to volume levels before you play it.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 1:05 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
peacedev wrote:
blargg wrote:
Why use something like blipbuf? Because otherwise the sound has a scratchy quality (due to aliasing) which pollutes the crystal-clear sound of the NES. This was evident in the recording you posted. I just wanted to bring it to your attention.


Are there any proof of audible alias which generate by sampling in 44100 hz?
I see when visualize or analyse them I can found it easily.
However by hearing as for me it not much different.

Try synthesizing (naively) a single square wave sweeping from 0 -> Nyquist (22050Hz) and you'll certainly hear it.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 4:48 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Yeah, I think it sounds awful when an emu has aliasing in its sound !

Fortunately it seems most NES emus solved this issue, but most GB/GBC/GBA emus does not. Even VBA which is the most popular GB/GBC/GBA have aliasing in it's sound. Result : All games which uses the game boy channels sounds bad. Even GBS players does have aliasing. :(


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 4:54 am 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
thefox wrote:
peacedev wrote:
blargg wrote:
Why use something like blipbuf? Because otherwise the sound has a scratchy quality (due to aliasing) which pollutes the crystal-clear sound of the NES. This was evident in the recording you posted. I just wanted to bring it to your attention.


Are there any proof of audible alias which generate by sampling in 44100 hz?
I see when visualize or analyse them I can found it easily.
However by hearing as for me it not much different.

Try synthesizing (naively) a single square wave sweeping from 0 -> Nyquist (22050Hz) and you'll certainly hear it.



Now I notice it, This may cause my sound distortion as well. Thanks a lot.
Will post lowpass/band pass filter help ? instead of bandlimiting

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 7:58 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19116
Location: NE Indiana, USA (NTSC)
Bregalad wrote:
Fortunately it seems most NES emus solved this issue, but most GB/GBC/GBA emus does not. Even VBA which is the most popular GB/GBC/GBA have aliasing in it's sound.

The NES output path has natural antialiasing, with a low-pass filter in the RF box. GBA and DS, on the other hand, use a PWM DAC at around 32.8 kHz that itself introduces aliasing. GBA emulators and GSF players just treat it as if it were a 44 or 48 kHz DAC. The GBA uses a higher sampling frequency (262 kHz) in GBC mode, and emulators and GBS players should in theory be sampling at that rate and using BLEP downsampling to hit 44/48 kHz.

peacedev: Band-pass (or low-pass) and band-limiting mean pretty much the same thing. BLEP is just an efficient technique to implement a combined low-pass filter and decimation for square-like waves such as the output of second- and third-generation consoles' APU.


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 8:08 am 
Offline

Joined: Sat Feb 23, 2013 12:41 pm
Posts: 10
tepples wrote:
Bregalad wrote:
Fortunately it seems most NES emus solved this issue, but most GB/GBC/GBA emus does not. Even VBA which is the most popular GB/GBC/GBA have aliasing in it's sound.

The NES output path has natural antialiasing, with a low-pass filter in the RF box. GBA and DS, on the other hand, use a PWM DAC at around 32.8 kHz that itself introduces aliasing. GBA emulators and GSF players just treat it as if it were a 44 or 48 kHz DAC. The GBA uses a higher sampling frequency (262 kHz) in GBC mode, and emulators and GBS players should in theory be sampling at that rate and using BLEP downsampling to hit 44/48 kHz.

peacedev: Band-pass (or low-pass) and band-limiting mean pretty much the same thing. BLEP is just an efficient technique to implement a combined low-pass filter and decimation for square-like waves such as the output of second- and third-generation consoles' APU.



Thank you very much.
You are very cool person :)

_________________
Peace Synthesizer Framework
http://peacedeveloper.appspot.com/docs/ ... index.html


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 9:31 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Quote:
GBA and DS, on the other hand, use a PWM DAC at around 32.8 kHz that itself introduces aliasing.

Does this apply to GB sound too ? I tought only the Direct Sound channels were affected by this.

At least I once made a test using the multiple available frequencies for the GBA PWM, and it turned out that while this affected strongly the Direct Sound channels (in a way that remains completely unemulated by the way), I remember it did not affect the GB soud in an audible way.
This was with my DS though - it's hard to record sound directly from the GBA SP now that my adapter has broken down.

Basically those were the results :
32 kHz PWM - 9 bits = horrible sound with lot of aliasing
64 kHz PWM - 8 bits = okay sound
128 kHz PWM - 7 bits = mediocre when the sound is quiet because of quantization
256 kHz PWM - 6 bits = Horrible sound because of quantization.

Link : http://dl.dropbox.com/u/23465629/GBA_junk/gba_test_samples.7z


Top
 Profile  
 
PostPosted: Mon Feb 25, 2013 9:49 am 
Offline
User avatar

Joined: Sat Jan 22, 2005 8:51 am
Posts: 427
Location: Chicago, IL
blargg wrote:
Why use something like blipbuf? Because otherwise the sound has a scratchy quality (due to aliasing) which pollutes the crystal-clear sound of the NES. This was evident in the recording you posted. I just wanted to bring it to your attention.

Is there a simple test-case for this (i.e., some game music that highlights the scratchy quality)? The Solstice intro, for example, is a good test-case for filtering out too-high frequencies.

I'm emulating the sound channels at 1.79MHz, low-pass filtering with a 512-tap FIR filter, and downsampling by 37 to get ~48kHz output. I suppose I haven't compared with a critical ear, but I don't notice any particularly scratchy differences between this method and the blipbuf method that I currently previously used.

(Note that I'm not trying to say that my method is better; it's certainly not from a CPU utilization perspective. I don't understand the blipbuf method well enough to re-implement it, and my goal was to build something sans copy-paste code/libraries).

edit: typo

_________________
get nemulator
http://nemulator.com


Last edited by James on Mon Feb 25, 2013 10:28 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

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 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