It is currently Mon Oct 23, 2017 7:17 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Sound Output
PostPosted: Tue May 10, 2005 3:40 pm 
Offline

Joined: Thu May 05, 2005 12:08 am
Posts: 4
Is anyone familiar with a simple way of doing sound output on the NES? What I'd like is a way to implement music or sound effects. All the docs I've found on the 'net are in japanese, so I'm kind of in the dark here.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 5:52 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3471
Location: Indianapolis
If you don't want to write your own music code, you can use NT2 (http://nesdev.com/nt2/). To get sound effects you can modify the player code to write to RAM instead of the sound registers, that way you can pre-empt the channels with your own sound effect code.

Most of the Japanese docs are probably about MCK, it's another simple way to make music. But the player code uses a lot of memory when I checked last, it might be tougher to use it inside another program.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 8:14 pm 
Offline

Joined: Thu May 05, 2005 12:08 am
Posts: 4
I guess what I'm trying to ask is "how do I play music?", or "how do I play a sound effect?" I'm not trying to do anything overly complicated here. Thanks for you help so far.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 8:47 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3471
Location: Indianapolis
You have to make your own data format (or use an existing one, but there isn't one specifically for sound effects), then have a player program that decodes it and outputs it to the NES sound registers. The player code would be ran every frame (60 times a second). Normally there's a second subroutine to be called for initializing a particular song/effect before playing.

Here's a reference on the registers.
http://nesdev.com/wiki/?page=NES+APU

This is pretty much how the NSF format works too. If you have memory free in the areas the NSF code uses, you can include it in a program and JSR to the play and init routines, and it works. I did that a lot myself with NT2 before I changed the player code to work with the assembler I normally use.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], Google Adsense [Bot] and 10 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