[split] NES audio emulation library?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
Jagasian
Posts: 421
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian »

Any chance you will work your magic on improving the standard of NES's audio emulation?
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

Well, my core is perfect and matches all blargg's tests. I have problems with the Windows sound output only, but my core is 100% accurate.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

What do we lack regarding sound emulation? We've got almost every detail of the NES APU, including behavior of the sound channels and the mixer. On the emulation side, several band-limited synthesis methods are available: linear interpolation, oversampling followed by downsampling and filtering, and band-limited impulse train. All of these synthesis methods allow for cycle-accurate APU emulation without much trouble or processor load.
Last edited by blargg on Thu Jan 11, 2007 4:48 pm, edited 2 times in total.
User avatar
Richter X
Posts: 11
Joined: Mon Aug 01, 2005 11:39 am
Location: Hagan, GA, USA

Post by Richter X »

Now if only Kode54 would update foo_gep....and upload the special in_gsf that has bandlimited synthesis for GB Audio.
User avatar
kode54
Posts: 67
Joined: Mon Jun 06, 2005 12:47 pm
Contact:

Post by kode54 »

Please die in a fire.

Can we split this already?

I've uploaded a new version, although I'm not really satisfied with the stupid mute/tempo dialog I've added, I'm sure everybody will love it just the way it is, until I decide to completely change it.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

What is missing is a library that I can plug into, say, a Windows based music editor to emulate the CPU and audio of an NES that is communicating with the PC program through, say, a bank of shared memory in $6000-$7FFF.
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

The Nes_Apu and Nes_Cpu components of Game_Music_Emu can be used to make this (there's also a standalone Nes_Apu in Nes_Snd_Emu, but I haven't updated that in a while). I can easily put together what you described and post it here. Can you be more specific about the requirements? For example, would the NES have a PPU, or just the CPU, APU, and 2K of low memory? Would it have a simple interrupt like in an NSF, that calls a routine at a specified rate? Hmmm, are you simply wanting to play an NSF programatically? If so, just use Game_Music_Emu as-is, which will allow you to load the NSF from a block of memory, seek anywhere (runs about 800x real-time internally, so it's quite fast), adjust the song tempo, and mute channels.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

blargg wrote:Hmmm, are you simply wanting to play an NSF programatically?
I'm wanting to rewrite the NSF with various "play", adjust the tempo as the user drags sliders, change between sections of the song as the user presses previous and next, modify instruments in real time as the user drags sliders, mute virtual instruments (which the NSF engine multiplexes into hardware instruments), and modify the song itself as the user enters notes on a keyboard. This may require real-time communication between the program in the NSF and the music editor.
If so, just use Game_Music_Emu as-is, which will allow you to load the NSF from a block of memory, seek anywhere (runs about 800x real-time internally, so it's quite fast), adjust the song tempo, and mute channels.
"Adjust the song tempo" how?
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

tepples wrote:I'm wanting to [...] mute virtual instruments (which the NSF engine multiplexes into hardware instruments), and modify the song itself as the user enters notes on a keyboard. This may require real-time communication between the program in the NSF and the music editor.
Yes. I can handle the emulation/synthesis back-end, if someone can do the Windows GUI/VST interface, and someone can write the NSF driver. The point is that the NES sound emulation stuff is available.
"Adjust the song tempo" how?
By changing the rate at which the NSF's play routine is called, as set by the play rate value in the NSF header. GME allows this to be adjusted as the track is playing (I think Kode54's foo_gep release menioned above has a tempo slider now).
Post Reply