Space99 - Music and Sound Effect Forum

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:ok, i think i can safely set out some rules regarding effects. You could even start inserting the code into places in the engine you think their should be a sound effect.
Great!
I think the best way to handle volume will be three locations, like VolumeA, VolumeB and VolumeC. It's up to u whether these should reside in zero page or main memory.
Basically the three locations will correspond to Effects allocated to A, B and C. The volume range will be 0 to 15.

Once the volume is written you will not have to write it again until it changes.
I will leave it to you to devise some method to work out distance, so that further events sound quieter than closer events.
Sounds perfect. If I understood correctly, I could use Channel A for step sounds (for instance) and set VolumeA to whatever value and keep it this way.
As for the Effects, each channel will hold up to 32 Effects, giving u a total of 96 effects. However i suspect we'll use a fraction of them.
When you need to call an effect, you can do the following

Code: Select all

lda #Effect
jsr InitialiseEffectVector
The initialise Effect routine can also be used at the start of the game to set the music irq up.
mmm I declare my incompetence here... May I suppose some effects will have an "finishing" envelope (such as step sounds) so I can jsr with the appropriate value in reg A when I need the "tic" sound, while others (such as computer beeps) will have "infinite" envelope so I jsr once to start them and another jsr with a given Effect value to stop them?
Their will also be a total of 24 tracks like short multichannel tracks or the title tune, high score tune or game over. and these use the above format except Bits 0-1 should be set to 3 (and the Track number into Bits 2-6).
The Music will also have an associated maximum volume (which may also be used for mute) and this will be held in VolumeA, so remember to set it before calling a Track.
Does music use the three channels? To be honest even if I see the nice effect of having music playing all the time, when effects are produced in another channel, I trend to hate that in a game... So I will be happy to have nice sound effects on channels and put music only on given moments...

Anyway the best thing here could be having each of the three channels dedicated to something. Channel A can be used for step sounds, for instance, as well as pick-up or interaction sounds. Channel B can be used for Messaging, so bips and blops can be made whenever something is displayed on the text area. Channel C can be used for alarm sounds and other environmental sounds (bips in the computer room, for instance).

Have no experience here, so ideas welcome. Maybe having Channel B for both message and alarm sounds and C for environment is a better idea.
Not sure yet what to do with Bit 7, it could act as a fade flag like when the hero dies the current effects could die away. Give me some ideas.
Nothing at this moment... Maybe later :)
By the way, the reason why i compact stuff into a single byte is to conserve memory on your side.
You could just store the effect number and have the Effect routine pick it up, but their may be a delay and scanning the location could use up valuable cpu time.
I can write the effect play routine for ingame sounds (and music) to optimise cpu time whilst nothing is being played.
This format is not final but can be if you are happy with it.
I like it a lot and do not see any inconveniencies. It would be indeed nice if you write an optimized routine... remember I left you quite a large space in page zero for this... :)

Best regards,
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Chema wrote: May I suppose some effects will have an "finishing" envelope (such as step sounds) so I can jsr with the appropriate value in reg A when I need the "tic" sound, while others (such as computer beeps) will have "infinite" envelope so I jsr once to start them and another jsr with a given Effect value to stop them?
Ok, this sounds like a better thing to do. For infinite sounds like Computer beeps we'll use the top bit (Bit 7) to stop the effect. Obviously triggering another effect on the same channel as the infinite effect will override it (stopping the infinite sound).

So...
Bits 0 - 1 == Set Channel (0,1,2) or Music Track(3) Modes
Bits 2 - 6 == The Effect number or the music Track number
Bit 7 == Play the Selected Channel(0) or Silence the selected channel(1)
Chema wrote:Does music use the three channels? To be honest even if I see the nice effect of having music playing all the time, when effects are produced in another channel, I trend to hate that in a game... So I will be happy to have nice sound effects on channels and put music only on given moments...
I agree, thats why when you call to play a Music track, it will stop all effects currently playing and play the incidental music.
And when you call any effect it will stop any incidental music before playing the effect.
The intention of Audio Tracker is not to share effects with Music but to give the provision from one point of entry to tell the sound routine to play effects when needed and music when needed.
I would envisage the same as you. That the game starts with the title tune, which then stops when the game starts. You move around with just Sound effects and maybe some environemental sounds. Then when you succeed at a particular point, the sound effects stop and some incidental 3 channel music is played. Then this goes silent again and the effects resume.
The volume rules
Under Audio Tracker, the volume you set in VolumeA,B and C will set the maximum volume for the given channel. The Pattern Volume is then based on this and the Effect volume is based on that.

The final output volume can therefore never exceed the volume you specified but the effect of the volume will sound much closer to the original intention of the effect.

For example if an effect plays a sequence of volumes like 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 and the volume is set in the pattern to 15 and you set VolumeA to 12, the output volume will be 12,11,10,9,8,7,6,5,4,3,2,1,0,0,0.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote: Ok, this sounds like a better thing to do. For infinite sounds like Computer beeps we'll use the top bit (Bit 7) to stop the effect. Obviously triggering another effect on the same channel as the infinite effect will override it (stopping the infinite sound).

So...
Bits 0 - 1 == Set Channel (0,1,2) or Music Track(3) Modes
Bits 2 - 6 == The Effect number or the music Track number
Bit 7 == Play the Selected Channel(0) or Silence the selected channel(1)
So I suggested a use for bit 7, without noticing :)
I agree, thats why when you call to play a Music track, it will stop all effects currently playing and play the incidental music.
And when you call any effect it will stop any incidental music before playing the effect.
The intention of Audio Tracker is not to share effects with Music but to give the provision from one point of entry to tell the sound routine to play effects when needed and music when needed.
I would envisage the same as you. That the game starts with the title tune, which then stops when the game starts. You move around with just Sound effects and maybe some environemental sounds. Then when you succeed at a particular point, the sound effects stop and some incidental 3 channel music is played. Then this goes silent again and the effects resume.
The volume rules
Under Audio Tracker, the volume you set in VolumeA,B and C will set the maximum volume for the given channel. The Pattern Volume is then based on this and the Effect volume is based on that.

The final output volume can therefore never exceed the volume you specified but the effect of the volume will sound much closer to the original intention of the effect.

For example if an effect plays a sequence of volumes like 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 and the volume is set in the pattern to 15 and you set VolumeA to 12, the output volume will be 12,11,10,9,8,7,6,5,4,3,2,1,0,0,0.
Ok, I think I understand... even if I won't be able to take most of the possibilities easily... Better have some effects to start with and add the necessary code to trigger them... Then I will play with more interesting things.

The idea of hearing sounds in the distance (I mean, depending on the distance) is indeed intresting. I will add some of these somewhere :)

Just give me the code and some effects to start with and I will start adding sound to the game!

Cheers.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

ok, for starters, i need to know what will be present in the system when you call the sound effect for the first time. For example will the oric be as if it were booted? (ie. Interrupts running at 100Hz)
i can offcourse write the routines to adjust the irq for sound effects, but it may save some bytes knowing the initial state of the machine. ;)

I've also started making a proper list of sound effects for each channel...

Code: Select all

Channel A: Player sounds, foot sounds, picking up things, moving things
0 - Switching Sound
1 - Door opening
2 - Door closing
3 - Object picking ("pic"-like sound)
4 - Object dropping
5 - Stepping sound #1 (two at different pitch, such as the two Oric's kbd clicks).
6 - Stepping sound #2
7 - Effect #1 for dialogue with other characters. (Maybe not needed)

Channel B: Set Music like hifi music, Computer room blips and blops, Menu system event sounds.
0 - New message through commlink.
1 - Beep for information messages in text area.
2 - Effect #1 for infopost menu system (selection changes and CTRL)
3 - Effect #2 for infopost menu system (selection changes and CTRL)
4 - Effect #3 for infopost menu system (selection changes and CTRL)
5 - Effect #4 for infopost menu system (selection changes and CTRL)
6 - Computer Room Blips #1
7 - Computer Room Blips #2

Channel C: Other object sounds like robot shuffling and lift movement.
0 - Alarm #1 for power low
1 - Alarm #1 for life support low. (something continuous on the background or something to sound when the text messages appear?)
2 - Robot Shuffle
3 - Lift Door Open (swish)
4 - Lift Door Shut (Swish Ding)
5 - Lift Moving (Continuous)
6 - Lift Stopping
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:ok, for starters, i need to know what will be present in the system when you call the sound effect for the first time. For example will the oric be as if it were booted? (ie. Interrupts running at 100Hz)
i can offcourse write the routines to adjust the irq for sound effects, but it may save some bytes knowing the initial state of the machine. ;)
I think we won't produce any effects until your irq routine is installed. So you already know how this is working ;)

Code: Select all

;The IRQ routine will run (Like Oric) at 100Hz. 
irq_routine 

        ;Preserve registers 
        sta a_reserve+1        ;Preserving registers like this saves us 11 cycles - 
        stx x_reserve+1        ;over using the traditional pha, txa, pha, etc. 
        sty y_reserve+1        ;Even using absolute self mod code like this!! 

        ;Protect against Decimal mode 
        cld 

        ;Clear IRQ event 
        lda via_t1cl 

        ;Process Sound Effects 
;        jsr proc_sfx 

        ;Process Music 
;        jsr proc_music 

        ;Process timer event 
        dec TimerCounter 
.( 
        lda TimerCounter 
        and #4        ;Essentially, every 4th irq, call key read 
        bne skip1 
        ;Process keyboard 
        jsr proc_keyboard 

skip1        ;Process controller (Joysticks) 
.) 
;        jsr proc_controller 


        ;Send Sound Bank 
;        jsr send_ay 

        ;Restore Registers 
a_reserve 
        lda #00 
x_reserve 
        ldx #00 
y_reserve 
        ldy #00 

        ;End of IRQ 
        rti 

I've also started making a proper list of sound effects for each channel...

Code: Select all

...

I agree. Just some comments as they come up to my mind :)

Channel A effects (player)
- Dbug stated that footsteps should not be two at different pitch, but just one or one with some random alteration of the pitch (something I think we can't support right now).
- As lifts are as any other doors, I will add their related effects here also.

Channel B effects (texts)
- Have a set of different effects for different text events (new message, informative text, dialogue,...)
- For menu systems I'd say only two effects might be needed: one for navigating and one for selection (CTRL).

Channel C effects (environmental)
- We can keep here environmental sounds only, Computer Room Blips, hifi music :), alarms...

I thin this way we can have them grouped so needed effects do not overlap on the same channel... We can have alamrs or hifi sound in the background while operating an infopost... (even if timed actions are paused in this case, just as an example).

On another note, your IRQ routine is deinstalled and a new one installed for disk access... Then it is installed again. I hope this does not upset your code, but turning off all efects in that process could be needed (?).
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Thanks for that code, i'd actually forgotten about it and in my slightly drunken state last night, wrote an effect driver completely forgetting the counter and key read routines.
I won't be around on Saturday but will try to get this sorted asap.

In fact just knocked up most of the effects mentioned above. These are currently in an Audio Tracker file. Now starting on Player proper.

Ok getting somewhere now. I've written and tested the compiler as best i can. :P The total memory for 18 effects including Pattern Headers and effect address tables but excluding music and SFX Player is 602 Bytes. :wink:
I now need reminding where this efx player is intended to start from?
$C000? :?:
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote: Ok getting somewhere now. I've written and tested the compiler as best i can. :P The total memory for 18 effects including Pattern Headers and effect address tables but excluding music and SFX Player is 602 Bytes. :wink:
I now need reminding where this efx player is intended to start from?
$C000? :?:
Excuse me... completely overlooked this question. In fact we can place it wherever you need. $C000 is Ok, as I can move the map anywhere else, but I would prefer having the sources, so I can place the player in normal memory (we still have some left there) and effects, patterns, world map, etc. into overlay.

How big would the player be? Because the effects being only 602 bytes is astonishing!

If possible it would be very nice to have everything as source files (including patterns, effects, etc.) so I can compile them and put them wherever I want. I can easily add them to the datafile on disk that is used to load things into overlay if needed.

Another thing I thought about is how to detect that a certain music has finished. I am imaging that, when you reach a sub-objective, some tune can be played and action can continue after this has happened. Mostly not to interrupt it with other sounds like steps. I could do a do-nothing loop checking for a bit indicating it has finished for example.

Also this may not be the best approach. You have more experience than me in developing games, so I will appreciate your ideas here...

Cheers
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte, any news about this?

If you can provide the sources needed for playing one or two effects I can start adding them to the main program and doing some tests... even if they are not definite...

Cheers
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Apologies, still at work atm. I have been busy here and also redesigned the Effects to be much more efficient both with memory, speed and simplicity.
I have also added some new commands like a Random Noise one for the footsteps (which works quite nicely) and a Random Delay (For the Morse code effect used somewhere)

But now i have redesigned effects, i must start again on the effects you want. Sorry :(
I am also wanting to release 0.6 of Audio Tracker this week.
I cannot emphasise enough that you have been very patient.

However i did notice recently (like you) a post i'd forgotten about, namely a nice link to loads of Space1999 sound effects (mp3) so i will try to emulate these as accurately now as i can.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Twilighte wrote:Apologies, still at work atm. I have been busy here and also redesigned the Effects to be much more efficient both with memory, speed and simplicity.
I have also added some new commands like a Random Noise one for the footsteps (which works quite nicely) and a Random Delay (For the Morse code effect used somewhere)
Great!
But now i have redesigned effects, i must start again on the effects you want. Sorry :(
I am also wanting to release 0.6 of Audio Tracker this week.
I cannot emphasise enough that you have been very patient.

However i did notice recently (like you) a post i'd forgotten about, namely a nice link to loads of Space1999 sound effects (mp3) so i will try to emulate these as accurately now as i can.
No problem. I am also really busy at work, so have little time for developing... so take your time :)

Anyway I think we have only left:
- Adding sounds, and menu entries at infoposts for sound control (maybe on off and two volumes: high and low).
- Fixing starting and ending sequences. At least some text when finishing the game... There is only one ending point, so it should be rather easy. Unless Dbug gives us some nice sequences ;)
- Want to have the initial data on disk, so when restarting you start again a new game. I want to have that on disk to save memory, but have to do this once the game is finished, so I know the exact data to store.

Of course we still have to do many beta-testing and some fixing, but we are quite near finishing this game!

Regards
User avatar
maximus
Flying Officer
Posts: 203
Joined: Thu Feb 23, 2006 7:45 pm
Location: Nimes, France

Post by maximus »

i heard BETA , so i say "Present !!" :lol:

hey great programmers , if you need some testeurs, OGC can help you :D
User avatar
Dbug
Site Admin
Posts: 4464
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Chema wrote:There is only one ending point, so it should be rather easy. Unless Dbug gives us some nice sequences ;)
Whistles... :D
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Ok, now in Finland and thoroughly enjoying myself. I would like to get this music done, but suffering a few set backs. I used multi-edit for all the source editing, but have left the install on my main pc in uk.
I have installed dosbox on my new laptop which runs under vista. Have yet to mount drives and install euphoric. So much to do just to get into AT.
Your songs sound ok Chema, but you don't fully use the capabilities of AT, though that will come in time.
Because the main tune is so instrumental i had taken the approach to not directly copy or try to port the midi but rather to listen to the original tune, create appropriate instruments and lay day a comparable score. Their are some techniques you can use on the AY that may not sound directly like the section of the original song but which sound better or more appropriate. Because the Computer game is in some ways faster than the series, we need to produce a tune that reflects this "passion".
I believe the jazzy bit after the instrumental part should be expanded to create a tune in itself, not something that is a single sequence. But we shall see.
Unfortunately the original effects i created cannot easily be ported to the new version of AT. To this end i will have to recreate them, either by recording the originals or by creating them from scratch again.
In all cases, the most important part now is to get the compiler working so that i can generate a final file for implementation into the game. :P
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

In case anyone did not notice.

In the General Discussion Forum
Twilighte wrote: I haven't forgotten Space1999 but atm i would really prefer if someone else could do the music and sound effects.
So the question is: Any one out there does have some skills in music and sound effects? If that is the case, are you willing to help?

Maybe Twilighte could end his audio tracker including the compiler and somebody else could do the music and effects for the game... I don't know how difficult this would be.

Regards
User avatar
Dbug
Site Admin
Posts: 4464
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

An alternative way to explore, is Fabrice's midi to ym converter.

The result will not be as great as would be a dedicated ym tracked music, but it would be better than nothing. And it's easier to find somebody that can do midi music.
Post Reply