| |
darro99
Registered: May 2017 Posts: 4 |
Play SFX with KickAssembler
Hi all!
I'm trying sound effects with KickAssembler 5.2.
I load the music file:
.var music = LoadSid ("musics.sid")
.pc = music.location "Music"
.fill music.size, music.getData (i)
Then I load the SFX:
.pc = $ 4000
FX:
.byte $ 19, $ 00, $ 00, $ C1, $ 81, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8, $ A8
.byte $ A8, $ A8, $ A8, $ A8, $ A8, $ 00
Once this is done I start the song. (It only sounds on a channel):
lda # 2
jsr music.init
On the main line I make it sound:
jsr music.play
When I want to load the SFX:
lda #<FX
ldy #>FX
ldx #14 //(I have tried with different channels 0, 7, 14)
jsr music + 6
But it does not sound anything. I do not know what I'm doing wrong.
Can somebody help me.
Thanks in advance. |
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
do you call the music play routine from a raster irq ? |
| |
darro99
Registered: May 2017 Posts: 4 |
Yes, and the music sounds, but when I want the FX to sound I use the code that I posted. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
it would help to know what kind of music routine do you use, any documents on how to use it with sfx ? I've never seen this kind of stuff, passing an address with .byte data to a player, maybe you just mixed up order of lo/hi or smth ? |
| |
darro99
Registered: May 2017 Posts: 4 |
Hello!
My developments are with the KickAssembler.
This compiler offers the import of .sid files through the LoadSid order that a player offers integrated.
Through the address $1000 and the value of the accumulator the song to be listened is selected.
Once this is done, the play subroutine ($1003 address) is called in the irq raster.
An example of this code:
http://theweb.dk/KickAssembler/webhelp/content/ch12s03.html
My problem is that I do not know how to do that while the music sounds add fx in the two free channels.
The code that I have posted to load the fx I have seen in documentation of the Goattracker. Chapter 5.1
The bytes in the FX label are copied from an .snd file converted with the INS2SND2 program from an instrument exported with the Goattracker.
Thanks again and regards. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
I cant help further, but there are many guys around knowing goat inside out here, lets wait for some of them chime in. |
| |
0xDB
Registered: Aug 2015 Posts: 27 |
Question, just to double check:
Has the "musics.sid" file been exported from Goattracker with support for effects enabled or is it a sid file from some other source?
Also, what I would do is set a breakpoint right before jsr music + 6 and then use builtin Vice monitor to step through and see what it does, find out which values get written to which SID registers. |
| |
darro99
Registered: May 2017 Posts: 4 |
Hi all!
I got the fx to work.
The file sid had not activated the support for effects.
I've gotten it to sound through the code of my first post.
Thank you very much for helping me get it. |