Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Francesco Sblendorio ! (Registered 2019-01-19) You are not logged in 
CSDb User Forums

Forums > C64 Coding > Play SFX with KickAssembler
2018-12-15 18:34

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
.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

Registered: Apr 2002
Posts: 4347
do you call the music play routine from a raster irq ?
2018-12-15 20:53

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

Registered: Apr 2002
Posts: 4347
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

Registered: May 2017
Posts: 4
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:

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

Registered: Apr 2002
Posts: 4347
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

Registered: Aug 2015
Posts: 13
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

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
Users Online
Almighty God/L64/Ons..
Guests online: 40
Top Demos
1 Uncensored  (9.7)
2 Unboxed  (9.7)
3 Comaland 100%  (9.7)
4 Edge of Disgrace  (9.7)
5 Coma Light 13  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.6)
8 Wonderland XII  (9.6)
9 C=Bit 18  (9.6)
10 X Marks the Spot  (9.5)
Top onefile Demos
1 Smile to the Sky  (9.7)
2 Daah, Those Acid Pil..  (9.5)
3 FMX Music Demo  (9.5)
4 Arok 20 Invitation  (9.5)
5 Pandemoniac Part 2 o..  (9.5)
6 Dawnfall V1.1  (9.4)
7 Crystal Gazer  (9.4)
8 Merry Xmas 2017  (9.4)
9 Rewind  (9.4)
10 Party Horse  (9.4)
Top Groups
1 PriorArt  (9.8)
2 Performers  (9.5)
3 Oxyron  (9.4)
4 Booze Design  (9.4)
5 Censor Design  (9.3)
Top Mega Swappers
1 Aslive  (9.4)
2 R.C.S.  (9.3)
3 Dishy  (9.2)
4 Nightshade  (9.1)
5 Calypso  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2019
Page generated in: 0.05 sec.