Starting to work on a sound engine
Moderator: Moderators
Starting to work on a sound engine
I'm going to start working on a sound engine so I need some help with it. Is it possible (and efficient) to make a sound engine that's songs are lists of patterns? The sound engine would read what pattern to play from the list. Once the pattern ends, it would return to the list and check the next pattern to play. Also, is it possible to make the sound engine read from FamiTracker's .nsf files?
UP SIDE DOWN A B A B B A B A Hidari migi
L R L R STOP & DASH & UP & TALK Ijou nashi
L R L R STOP & DASH & UP & TALK Ijou nashi
Re: Starting to work on a sound engine
Yes, sound engines commonly represent music as lists of patterns in the way you describe. And yes, FamiTracker includes a "text export" command to convert FTM to a text format that your own translator can use.
Re: Starting to work on a sound engine
I just tried the text export, but the output doesn't really look like something that NESASM3 would understand if I added it to the program.
UP SIDE DOWN A B A B B A B A Hidari migi
L R L R STOP & DASH & UP & TALK Ijou nashi
L R L R STOP & DASH & UP & TALK Ijou nashi
Re: Starting to work on a sound engine
You probably have to parse the output somehow to make it useful.
Re: Starting to work on a sound engine
FamiTracker's text output is intended for you to write a PC program to translate the output into sequence data suitable for your own music engine. You might write this in C++, C, Java, JavaScript, Python, or whatever. Do you know any PC programming languages?
Re: Starting to work on a sound engine
Does Touhou Danmakufu and Game Maker count? Otherwise, no. I have some old version of FamiTracker that has .NSF export. Can't I use that?tepples wrote:Do you know any PC programming languages?
UP SIDE DOWN A B A B B A B A Hidari migi
L R L R STOP & DASH & UP & TALK Ijou nashi
L R L R STOP & DASH & UP & TALK Ijou nashi
Re: Starting to work on a sound engine
In theory you can use .incbin to include the body of FamiTracker's NSF export at the load address and play music through that.
In practice it's a lot harder for at least two reasons. One is that the NSF interface defines no way to play sound effects on top of the music. The other is that an NSF is allowed to use the machine's whole memory except for the top of the stack, which means you don't know in advance which memory your game is allowed to use.
In practice it's a lot harder for at least two reasons. One is that the NSF interface defines no way to play sound effects on top of the music. The other is that an NSF is allowed to use the machine's whole memory except for the top of the stack, which means you don't know in advance which memory your game is allowed to use.
Re: Starting to work on a sound engine
If you include the whole NSF you'll be including more than the song data, since NSF files include the player code as well.Tsutarja wrote:I have some old version of FamiTracker that has .NSF export. Can't I use that?
I imagine you could analyze the NSF and extract only the data from it, but if you use the exact same data format as FamiTracker you'll be essentially reimplementing the FamiTracker player, which is silly.
If you're implementing your own sound engine, you'll need to come up with your own data formats, and in order to handle custom file formats you absolutely need some programming experience.
Re: Starting to work on a sound engine
I guess this would be the easiest way to get sound working. I'll try it when I have more time.
UP SIDE DOWN A B A B B A B A Hidari migi
L R L R STOP & DASH & UP & TALK Ijou nashi
L R L R STOP & DASH & UP & TALK Ijou nashi