MOD-player with external sound effects
I know there are some very good Protracker MOD-players out there. But is there also a version which permits a game to insert sound effects in the middle of the music?
At least it should be able to deactivate a pre-selected channel during the period when the effects sample is played. Better would be when the player itself automatically selects an idle or least frequently used channel for this task. Optimal would be when it mixes the effect somehow into the music. |
Never heard of these things specifically, but isn't Pinball Dreams/Fantasies using common Protracker modules? Most of the sound effects are played with the music still running in background so if I'm not wrong this might use some real time mixing. Another interesting example is Jochen Hippel's 7-voice routine which doubles 3 of the 4 channels and maybe reserves the 4th for interactive stuff like sound effects (I'm not quite sure about this, infos are hard to find). Another interesting one is Deluxe Galaga by Edgar M. Vigdal where the user can decide himself which tracks are used for music or effects and also can add his own modules if he likes.
|
Perhaps you can try to rip/use Dens Design Protracker replay routine from game Aladdin, it has support for SFX. WT's external Protracker replay for EaglePlayer is based on this version, but I don't know if you are able to understand my source.
|
Quote:
Quote:
|
Quote:
Quote:
|
Quote:
|
Quote:
Sound effects are easier to deal with than music because you don't have to worry about multiple pitches. If you make sure they all use the same sample rate, mixing them is relatively trivial. |
Quote:
You can get resourced Protracker (Aladdin) replay from the WT page: http://wt.exotica.org.uk Players section. |
Quote:
|
Quote:
I remember a similar example - I think it was the Outrun Europe soundtrack on the C64 by Jeroen Tel - where the whole music only occupies 2 channels (and still sounds awesome). Regarding this kind of channel "economy", chip music might offer a few more options, because you can create interesting mixtures of bass sounds or short strings with percussions in one sample - and in realtime. |
Quote:
|
As I already wrote in the other thread. BabeAnoid (Amos game but the best breakout clone for Amiga ever) from Richard Fhager (DawnBringer) used two (1,2) channels for effect samples and two (3,4) for music. Nothing special but effect samples just overwrite the current samples that might be played on the first two channels. So you (as musican) can use still all four channels for music. If you know this you can make music that sounds great in both situations. Hence, it is good for games. :)
Check out: http://hem.fyristorg.com/dawnbringer |
Quote:
|
From experience it's quite a job to make sfx/music share 4 channels, to make it not cut off notes. For the gameplay (in action games), you absolutely need to start the sfx exactly when they're triggered and not skip a single one, or the player will wonder if he jumped or picked up something etc. At the same time with this "absolute priority", you don't want the music to cut off randomly :)
You can have a sfx/music toggle, this is what I always like best in games. Because after a while you've heard the music a few times before... :) A simple solution is to have 3-channel music of which 1 is a shared, low-priority-music channel (melody). In this channel, low-priority-sfx (shots, environment) win over music. The 4th channel is reserved for normal-priority-sfx only, so the important sounds like rewards and feedback sounds like thuds are always heard. Since it is per-channel priority, you don't need a priority scheme, really. Important sounds are simply played in 4th chan, all others in chan 3 (simply play them there, it's ok if music in this chan is cut off), and don't touch chan 1-2. :) |
The suggestion to restrict the music on 3 channels is good, but in many cases it cannot be done easily, because the MODs already existed before the game and it is hard to convert them to 3 channels.
Isn't it possible to use the audio interrupt for inserting effects? I'm thinking about the following: As far as I know the player will set a channel to a two-bytes null-sample shortly after starting a one-shot (non-looped) note. This can be used as an indicator that the channel is free for the next sample, as soon as it got an audio interrupt. This channel can be used to play a sound effect now, which blocks the music on the channel, until the next audio interrupt happens (the sound effect is finished). When there is no free channel for a sound effect, the player could decide to cut the music on the channel, which didn't play a new note for the longest time. Or just take a default channel, when the priority of the effect is high enough. Using audio interrupts will have the disadvantage that a lot of additional cpu time will be needed to process the interrupts for all four channels (especially when all channels are running the null-sample). So I'm not sure if it makes sense... EDIT: Maybe I don't need to enable audio interrupts at all, but just clear the channel's audio interrupt flag when the pointer to the null sample is set. When the channel is still playing the null sample and the channel interrupt flag got set, then it is free? |
All times are GMT +2. The time now is 18:03. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.