Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
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: 5094
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: 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 ?
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: 5094
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
Derision/Longshot
Mike
Case/Padua
katon/Lepsi De
Fred/Channel 4
Barfly/Extend
Sokratekk
Guests online: 74
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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