English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 21 July 2010, 21:35   #1
SyX
Registered User

 
Join Date: Sep 2004
Location: Brasil
Age: 44
Posts: 144
Playing Music and SFX

Well, i'm adding music at my game engine (OCS/ECS 1Mb), because it's time to make happy my ears

In the old times i was accustomed to reserve one or two channels for the SFX and made the songs using only the free channels. But it would be great if i could use the four channels for the music and when i need to play a sfx, i only would have to send it at one channel and would take priority over the music.

I was thinking to use The Player or another fast protracker routine, but after the first look i can not find an easy way to add SFXs. Is there any protracker routine that support this? Or can anybody advise about the most sensible way to implement this?
SyX is offline  
Old 24 July 2010, 19:07   #2
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,589
Games by talented guys, like Hybris/Battle Squadron, Turrican etc use clever techniques to "hide" the uhm lack of channels by having 3-4 channel music but putting parts of the composition "that the ear needs most to feel continuity in the music" in reserved channels. For example bass+drums in chan 0 and harmonies or chords in chan 1, and then have melody and "extras" for the music in two optional channels that get overridden by SFX.

You can rearrange the music to f.ex. 3 channels and set number of channels in The Player, then the unused channels won't be touched.

I always feel I get more "into" the game if all 4 channels are used for an absorbing barrage of SFX only, I love that Music can be played as interludes, f.ex. "loading level" or "big ship landing" or "here comes a boss".

The usual way to "hack" a module player is to
put a "don't write to soundregisters if SFX is playing" conditional in the part that starts a sample
put a "don't write to soundregisters if SFX is playing" conditional in the part that sets the samples' loops (look for a busy-wait or a CIA interrupt)
put a "don't execute musiceffectcommand if SFX is playing" conditional in the 1 or 2 places that handle effects.

A fail-safe quick hack method is to patch each and every single write to audio-registers with a conditional that checks if the SFX routine has "tagged" that channel and if so skips it. (The only thing you have to watch out is for code triggered by an audio-interrupt, but I haven't seen any in the normal .mod players.)


If a soundeffect reserves a channel, you must have some kind of timing-value to release it back to the playroutine after "a while", of course.


Edit: Jesus "Christ", that's a lot of "double quotes". Poor "post writing". Oh well
Photon is offline  
Old 25 July 2010, 18:43   #3
SyX
Registered User

 
Join Date: Sep 2004
Location: Brasil
Age: 44
Posts: 144
A lot of thanks, Photon!!!

Really Great Explanation!!! I see a few afternoons of The Player in my near future

Quote:
Originally Posted by Photon View Post
I always feel I get more "into" the game if all 4 channels are used for an absorbing barrage of SFX only, I love that Music can be played as interludes, f.ex. "loading level" or "big ship landing" or "here comes a boss".
Yes, i think similar, now my soul is asking me to transform my actually sources in a Jet Pac/Defender/Dropzone/Recoil/Hyperactive/Retaliot clone for Amiga ... but my question was with the idea of a more slow kind of game how a platform or a puzzle.

Quote:
Originally Posted by Photon View Post
Edit: Jesus "Christ", that's a lot of "double quotes". Poor "post writing". Oh well
Well, don't worry it was one of that rare case of "abuse" "of" "double" "quotes" nothing important, could be worst how a serious case of abuse of bold and smilies
SyX is offline  
Old 27 July 2010, 04:26   #4
Hewitson
Registered User
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 36
Posts: 2,618
The Turrican games I believe actually achieve 7 channels by software mixing. This could well be worth looking into.
Hewitson is offline  
Old 27 July 2010, 11:08   #5
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,200
AFAIK Turrican only uses software-mixing in the intro. During the game it would waste too many cycles. The music is in Chris Hülsbeck's TFMX format.
phx is online now  
Old 27 July 2010, 11:19   #6
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,146
Quote:
Originally Posted by phx View Post
AFAIK Turrican only uses software-mixing in the intro.
That's correct.
StingRay is offline  
Old 27 July 2010, 22:59   #7
SyX
Registered User

 
Join Date: Sep 2004
Location: Brasil
Age: 44
Posts: 144
Also it's more easy to find a good protracker musician (i must try to recover at my old pal Rush ) that a musician that can use tfmx and Chris put the level in tfmx music too high
SyX is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
What are you playing? Sensi Retrogaming General Discussion 3865 Today 18:07
[request] Separate music/sfx volume slider Retro-Nerd support.WinUAE 3 07 August 2013 19:41
Help needed for playing tactical music in UFO AGA ancalimon support.Games 0 23 November 2011 03:27
No SFX in IK+ tim_calladine support.Games 21 25 October 2008 01:00
2-4 sec delay of music playing Lord support.Demos 0 24 June 2002 00:27

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.10214 seconds with 13 queries