It is currently Sun Nov 19, 2017 5:06 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Tue Aug 16, 2005 12:04 am 
Offline
User avatar

Joined: Sat Jul 09, 2005 6:03 am
Posts: 85
I've been working on my side-scroller now for awhile and I have come to the point where I want to start adding sfx and music. The problem is, I'm not sure how to go about it. MCK is to slow for a game, NT2 won't run correctly on my machine. I would write my own playback code if I knew where to start.

So what's a viable option for music and sound fx for an actual game? How would I go about writing my own playback stuff (doesn't need DMC support beacuse my game runs on a Mapper #0 cart and I want to save memory).

Any input would be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 12:31 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
NT2 will become usable if it isn't already. Running it with VDMSound works for me, though it's a tad bit inconvenient. I know someone who has ported NT2 to win32, surprisingly. I just tested it the other day and it seems to work fine natively. It looks and runs the same as it used to. It'll be on the NT2 site once he has a version ready. I could ask him to pass you a test copy if you want.

NT2 is pretty effecient with it's RAM and CPU use. The main thing to watch out for though is CPU usage spikes depending on what plays on the first line of a new pattern. Sound effect support can be added pretty easily, I've done it probably the same way Matrixz did in NeSnake 2. Which was changing the sound register writes in NT2's code to write to RAM, then you can overwrite it if you want to play sfx.

There's another tracker here also:
http://2a03.org/forum/viewtopic.php?id=365&p=1
It's new, I haven't taken the time to test it's code yet. If you do, let me know how it looks for game usage.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 1:36 am 
Offline
User avatar

Joined: Sat Jul 09, 2005 6:03 am
Posts: 85
Quote:
NT2 will become usable if it isn't already. Running it with VDMSound works for me, though it's a tad bit inconvenient. I know someone who has ported NT2 to win32, surprisingly. I just tested it the other day and it seems to work fine natively. It looks and runs the same as it used to. It'll be on the NT2 site once he has a version ready. I could ask him to pass you a test copy if you want.


Yes. I got NT2 working and I got nedplay working. I would like to have the win32 version beacuse I still get odd error messages on exit and some other oddities. So yea, I think I want to try that test copy, and maybe let me know were to find its final version when its done.

Quote:
NT2 is pretty effecient with it's RAM and CPU use. The main thing to watch out for though is CPU usage spikes depending on what plays on the first line of a new pattern. Sound effect support can be added pretty easily, I've done it probably the same way Matrixz did in NeSnake 2. Which was changing the sound register writes in NT2's code to write to RAM, then you can overwrite it if you want to play sfx.


I'm looking at the play back source code. You say I should replace the writes to the $40xx sound registers with writes to my own memory in RAM, then in my own game, I can either write whats been written by the music player, or just write my own sound effects. Sounds good but that's alittle bit of work and I was wondering if the modyfied source for that was laying around anywhere. What's the base address for all of the RAM used by the ned play back program? I'm starting to get alittle confused...

Well... time to start getting used to using NT2. I've never used a tracker like this before.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 2:48 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
I just wrote my own sound code several weeks ago. It took me just one day, and it's cool because you can input all feathures you like, and avoid feature you dislike, to prevent wasting RAM and ROM. Typically, I hate the arpeggio effect, and I'll never use it in any of my musics, so I don't need a sound code who can do that. Same goes with DMC support, vibratoes, etc...

To start, you first have do design yourself how to encode music, with 12 different possible notes, and many different possible timelenghts. You can fix yourself if you use the hardware decay for square channels, or if you prefer do volume in software, if you want to use the timer of the triangle channel or if you prefer time it in software, etc, etc....
For the sound effects, I just duplicated all channels exept triangle, and then if the sound effect channel is active, the music channel writes are ignored.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 4:31 am 
Well, I've started transposing a song to NT2 but I can't fine tune the tempo. The tempo I want is 170 BMP which is in between setting $F02-03. I spaced my notes out to allow for 32nds. Hmm..... Any suggestions?

Bregalad : Maybe I'll butcher the ned player source and take the DMC stuff out. Might save some space. Since this is for a small game, it is not needed. Also, do you type out the raw hex values for your sound code you metioned or do you use some kind of editor.


Top
  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 5:03 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
I did just make my data with .db, if it is that you want to know.
Actually, I dislike NT2 pretty much. It is hard to understand how it works, and it has pretty bad features (well, it has good features for the pitch, but very bad features for the volume, and I think the volume is more important), and had a lot of glitches while saving/loading song, and eventually it plays its own songs badly, and anyway it works very bad under Win2000, like every DOS programm I have that make sounds (it has pop and ckacks). Eventually, if you want to include it in a game it wastes a lot of ROM space, and it can't playback sound effects until you modify the code. Also you're forced to use CA65 if you want to change the code, except if you rewrite the whole code for another assembler, in that case you've better to write your own code.

Well, to do the tempo, myself, I just had running this :
Code:
lda TempoCounter
clc
adc TempoValue
sta TempoCounter

If the carry is set, you have to decrease all the timers for all tracks, the tempo value can be anything but zero, and the tempo ran be ruled with a high precision with this method. It can even be modified by the main code to do effects like Battletoads (where the music sometimes fast up) or Chrono Trigger (where the music sometimes slows down). I'm pretty sure NT2 doesn't use this.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 3:00 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19227
Location: NE Indiana, USA (NTSC)
Anonymous wrote:
Well, I've started transposing a song to NT2 but I can't fine tune the tempo. The tempo I want is 170 BMP which is in between setting $F02-03. I spaced my notes out to allow for 32nds. Hmm..... Any suggestions?

At 60 Hz, what you want is 450 / 170 = 2.647 ticks per 32nd note.

This pattern, which you might put out of the way in the DMC or noise channel, will give you 2.5 ticks per 32nd note or 450 / 2.5 = 180 BPM:
Code:
--- -- F02
--- -- F03
--- -- ---
--- -- F02
--- -- ---
--- -- F03
--- -- ---
--- -- F02
--- -- ---
--- -- F03
etc.

This pattern will give you 2.65625 ticks per 32nd note or 169.41 BPM:
Code:
--- -- F02
--- -- F03
--- -- ---
--- -- F02
--- -- F03
--- -- ---
--- -- F02
--- -- F03
--- -- ---
etc.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 9:47 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
OK, it's released now.

http://nesdev.com/nt2/download/NT2.ZIP


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 12:13 pm 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
nice!
is this final version of the port? of will there be more fixes?
but anyway as I said before, nice! :D

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19227
Location: NE Indiana, USA (NTSC)
Memblers wrote:

Thanks! Now I can finally get back into NES music.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 7:53 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
dXtr wrote:
nice!
is this final version of the port? of will there be more fixes?
but anyway as I said before, nice! :D


Sounds unbelievable, but there could be. The person who ported it said if there are any requests, to email him (the email address is in NT2.txt in the credits section near the bottom).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 8:36 am 
Offline
User avatar

Joined: Tue Sep 21, 2004 12:11 am
Posts: 377
Location: Karlshamn (Sweden)
Memblers wrote:
Sounds unbelievable, but there could be. The person who ported it said if there are any requests, to email him (the email address is in NT2.txt in the credits section near the bottom).

k. mostly wonderd b/c it semed to ficker/flicker (don't no which word to use ;) ) when drawing the screen (but that can always just be my screen and there by nothing to care about). nothing important anyway.

edit:
tested to run it fullscreen and then everything was ok. so I guess it's only in window mode.

_________________
Sorry for misspellings, I'm from Sweden ^^


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 1:42 pm 
Offline
User avatar

Joined: Sat Jul 09, 2005 6:03 am
Posts: 85
Sorry, I didn't feel like I needed start a new thread. Anyways...

I ended up making my own playback code. You can check out a demo here http://mbrenaman.com/soundy.zip.

I just have one question. Which sound emulator is the most accurate? Beacuse in some emulators, when I update the period for vibrato notes, the wave form of the note gets reset with every write to the period registers. The NSF Winamp plugin doesn't do this nor Nesten. I haven't tried Nintendulator with the sound on beacuse it runs pretty slow on my machine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 2:29 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3483
Location: Indianapolis
Sounds good. :)

I don't know which emu is most accurate, but on the real system writing to $4003/$4007 will reset the duty cycle and envelope (likewise for $400B and $400F too).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 2:32 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
Looks fairly good, actually it even is more advanced than the write I wrote on myself that is only focused on volume and that doesn't allow pitch effects at all for now (I'll surely do a second version someday).
The music is cool, in Bubbleman style 8)
About the period resed, I think you should avoid re-writing to $4003/$4007 during a note, exept if you want do this to have a grumble effect like Just Breed does. This cause problems for some vibratoes, where the period *should* be resetted anyway because the high 3 bits of frequencey are affected. This cause no problem on the triangle channel, however. (actually, all that stuff make me stay away of vibratoes/slides exept by sweeping hardware for now).

_________________
Life is complex: it has both real and imaginary components.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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