When I was asking questions in the newbie forum regarding Famitracker driver, I was told that if I find how to play sound fx with it that I should inform the community on how to do it.
To do it, I had to modify the driver so it can disable some channels on demand. Once a channel is disabled, in your main code, you can play your sound fx. It was not possible to ask FamiTracker to play the effect with another song since it would had required to have virtually 2 times the variables for the song's information: the old one still play while the new one take's over. Since the footprint in memory is already 220 bytes, I decided that it's not worth it for now.
At the end of the process, you restore the channels and the music continue to work properly.
Here's the link to the my updated sample with the working sound effects: (removed)
You just press the a button and your will hear a sound fx. This version correct the issue with square channels compared to the one in the newbie forum.
Of course this sample doesn't have a sound fx engine, I just play one sound and that's it. If you start a sound a decide in the middle to start another one, you have to restore the channels first then start playing your new songs. If you don't, the squares channels of your song could be affected.
I can explain later in more details how to use it if some people are interested. For now, the current sample should (?) be enough. If you have questions regarding the code, don't be afraid to ask
If people do get interested in this driver, I don't know if someday if would be interesting to port it to other assembler like nesasm, wla etc. That could be an interesting quick project to do.
edit (2008-10-14):
I renamed the thread since I want to use only one for this subject and stop starting new one. I will add new content when my progress goes forward.
edit 2008-10-24:
You should not use the experimental version anymore. Take the RC1 instead mentioned below.
To do it, I had to modify the driver so it can disable some channels on demand. Once a channel is disabled, in your main code, you can play your sound fx. It was not possible to ask FamiTracker to play the effect with another song since it would had required to have virtually 2 times the variables for the song's information: the old one still play while the new one take's over. Since the footprint in memory is already 220 bytes, I decided that it's not worth it for now.
At the end of the process, you restore the channels and the music continue to work properly.
Here's the link to the my updated sample with the working sound effects: (removed)
You just press the a button and your will hear a sound fx. This version correct the issue with square channels compared to the one in the newbie forum.
Of course this sample doesn't have a sound fx engine, I just play one sound and that's it. If you start a sound a decide in the middle to start another one, you have to restore the channels first then start playing your new songs. If you don't, the squares channels of your song could be affected.
I can explain later in more details how to use it if some people are interested. For now, the current sample should (?) be enough. If you have questions regarding the code, don't be afraid to ask
If people do get interested in this driver, I don't know if someday if would be interesting to port it to other assembler like nesasm, wla etc. That could be an interesting quick project to do.
edit (2008-10-14):
I renamed the thread since I want to use only one for this subject and stop starting new one. I will add new content when my progress goes forward.
edit 2008-10-24:
You should not use the experimental version anymore. Take the RC1 instead mentioned below.