Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Play SFX with KickAssembler
2018-12-15 18:34
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.
2018-12-15 20:45
Oswald

Registered: Apr 2002
Posts: 5017
do you call the music play routine from a raster irq ?
2018-12-15 20:53
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.
2018-12-15 23:38
Oswald

Registered: Apr 2002
Posts: 5017
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 ?
2018-12-16 11:37
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.
2018-12-16 12:17
Oswald

Registered: Apr 2002
Posts: 5017
I cant help further, but there are many guys around knowing goat inside out here, lets wait for some of them chime in.
2018-12-16 13:04
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.
2018-12-17 19:04
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.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
tlr
Fred/Channel 4
freejack
Bieno/Commodore Plus
Guests online: 97
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.049 sec.