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 > SFX while playing 3 voices
2010-12-28 20:28
Bago Zonde

Registered: Dec 2010
Posts: 29
SFX while playing 3 voices

Hello, this is my first post on this forum, so Hello everybody and a lot of greetings!!

I'm writing game for C64 in pure assembler and I want to ask You about some possibilities of sfx and digis. I'm newbie in assembler, just 2 month of programming (and few years with basic), but my progress with game called Meonlawel is really noticeable for me. There's usual loading, saving, move screen, changing chars (all in Hi-Res), playing music and controls so I see that assembler is really great, really :) !!! If somebody would to know more about Meonlawel, website will be available soon. However, due to this good progress and my growing faith in that project I'm curious about what sfx can do with bombarding $D418 while playing all 3 voices and how to do it? Music is playing from $8000 with IRQ. I was trying with some sounds e.g. nice & short (around one second perhaps) switch sound during main screen while selecting options.

So, can anyone could help me with easy procedure for test which can play primary SFX sound, because I was trying a little bit and I don't know if that's a good solution because only what I heard was stop playing one of voice channel and some truncate sounds.

I have no idea & experience what C64 could do for me in that category. I think that playing "fourth" channel simultaneously can't be done as one more voice in fact but it's possible in some ways to reach the target.

Sorry for my English and best wishes in upcoming 2011 ;).

Bartek
2010-12-28 20:43
Hein

Registered: Apr 2004
Posts: 954
Have you tried playing digis without music? On 6581 SID chip?

Music routines also use the $d418 register (mainly for filters during playtime), so you may have conflicts.
2010-12-28 22:10
Bago Zonde

Registered: Dec 2010
Posts: 29
Hello, fanx for reply.

I've written a little procedure shown here. If unnecessary to include it - sorry for that, but maybe somebody would tell me if there's any mistakes (or somebody would use it if I'm right) because I'm learning C64's map from A to Z, for now fourth channel especially:

LDA #$00
STA $D412 ;Voice #3 Register (Gate=0)

LDA #$08
STA $D411
LDA #$00
STA $D410 ;Pulse Width to $0800 = 2048

LDA #$0F
STA $D418 ;Volume to 15

LDA #$41
STA $D412 ;Voice #3 Register set to pulse (Gate=1)

LDA #$69
STA $D413 ;Attack/Decay set to 6/9 = 6*16+9=105

LDA #$01
STA $D414 ;Sustain/Release set to 1

LDA #$10
STA $D40F
LDA #$08
STA $D40E ;Frequency set to 156.6 = $1008

and it's working properly but it's overriding #3 voice so "The Fourth" is just a legend? I thought there's really something. While SFX playing (it's just a longer pulse), tune's pitch is changed because of playing tune on voice #3 from subtune. And filter on voice #3 become changed after SFX have finished, I can heard only a burps.

So, is there any possibility to store all values from currently playing tune on voice #3, then turn off that voice to freely playing SFX, then if it's done, just restore values and unblock voice #3 for subtune? If yes, I could work on that. All because one of my subtunes is a little ambient music so sounds are playing for time to time, not too often.

I've tested that on real 6581 and on Vice emulator, on real C64 - unfortunately a filter is more quiet, but it's filters. Moreover all is that same on emulator and real C64.

2010-12-29 01:10
Stryyker

Registered: Dec 2001
Posts: 468
Have a look at the routine that plays the music. Some have easy methods of blocking one voice.
2010-12-29 06:40
Hein

Registered: Apr 2004
Posts: 954
I thought you were talking about digis, the magical 4th channel :)

International Karate, Bangkok Knights, Mega Apocalypse for example use digis while playing 3 channel music.

Goattracker contains an sfx routine that temporarily disables the 3rd channel. No idea about other music routines.
2010-12-29 10:55
Bago Zonde

Registered: Dec 2010
Posts: 29
Hein, so if I'll include digis player, not just this procedure playing sounds and find something what can block one of voices for a while, there's a chance to play digis? I found some informations about digis but I can't understand it at all. I have some digis on diskette, so I'll try to use them. I have not idea what to do with it for now. Is it alright going that way? Of course "magical 4th channel" is just one of 3 available voices overriding, yes?
2010-12-29 12:54
Isildur

Registered: Sep 2006
Posts: 275
Quote: Hein, so if I'll include digis player, not just this procedure playing sounds and find something what can block one of voices for a while, there's a chance to play digis? I found some informations about digis but I can't understand it at all. I have some digis on diskette, so I'll try to use them. I have not idea what to do with it for now. Is it alright going that way? Of course "magical 4th channel" is just one of 3 available voices overriding, yes?


4th channel is just an illusion, but it sounds like 4th channel :)
Depends on what player you use, there are switches to disable 1 to 3 channels.

Another option is to compose tune with two channels and use 3rd to sfx.
2010-12-29 13:30
Bago Zonde

Registered: Dec 2010
Posts: 29
So if it's just an illusion, I should switch off one of channels for a while then turn it on when SFX sound it's done. Something like priority.

However I don't know how to do it, but I'll try with some more practise and more diggin'.

Maybe somebody know how to do it with Goat Tracker subtunes?

I found only that for init SFX in GT manual:

LDA #<effect ;Start address of sound effect data
LDY #>effect
LDX #channel ;0, 7 or 14 for channels 1-3
JSR startaddress+6

But I don't know for now what will exactly happen.

Working with 2 voices is of course a good idea, but I want only a few SFX signals during gameplay (selecting options, opening doors, maybe some sounds when magic released) and music tunes are more important to me so it should be expanded to 3 voices for more interesting music. However I'm not so great to squeeze 3 channels into 2, that's job for masters of sounds :).
2010-12-29 14:13
Isildur

Registered: Sep 2006
Posts: 275
How about to skip playing routine for a sec during sfx?

little algorithm :)

if need sfx jump to skip:
...
...
jst $1003 ;play tune
...
...
skip: play SFX
...
...


2010-12-29 15:58
Bago Zonde

Registered: Dec 2010
Posts: 29
Yeah, but no need to switch off all voices, I should find solution for disabling one channel in that way You described.
2010-12-29 16:49
GT
Account closed

Registered: Sep 2008
Posts: 308
Adjust the music player to ignore writes to the SID register of the chosen voice/s you want to use for SFX when they occour. But keep the music player running.
 
... 6 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
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
MWR/Visdom
Steffan/BOOM!
Barfly/Extend
DJB/Onslaught / Blue..
algorithm
zscs
Guests online: 106
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 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (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 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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