English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   MOD-player with external sound effects (https://eab.abime.net/showthread.php?t=64514)

phx 01 June 2012 14:44

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.

pintcat 11 June 2012 10:58

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.

Don_Adan 11 June 2012 14:08

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.

phx 12 June 2012 10:48

Quote:

Originally Posted by pintcat (Post 822801)
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.

I guess that mixing is no option for me, as it requires too much CPU power, which I desperately need for the game (I hope it will run at 25fps on a 7MHz 68000). Pinball certainly doesn't need that much power.


Quote:

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.
BTW, is the source of Deluxe Galage available for free now? I remember that he offered it against a registration fee many years ago.

phx 12 June 2012 10:51

Quote:

Originally Posted by Don_Adan (Post 822839)
Perhaps you can try to rip/use Dens Design Protracker replay routine from game Aladdin, it has support for SFX.

You're sure about that? Reassembling and analyzing the game would take some time. I hoped there were easier options.

Quote:

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.
Hm? What is your source? Aladdin or EaglePlayer? :)

Codetapper 12 June 2012 13:09

Quote:

Originally Posted by pintcat (Post 822801)
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.

I can't remember where I read it but I believe that 7 voice routine is actually mixing 4 channels into 1, plus the other 3 "normal" channels giving the 7. Presumably the modules use instruments and samples that mix well together for that 4th channel.

robinsonb5 12 June 2012 14:33

Quote:

Originally Posted by Codetapper (Post 823009)
I can't remember where I read it but I believe that 7 voice routine is actually mixing 4 channels into 1, plus the other 3 "normal" channels giving the 7. Presumably the modules use instruments and samples that mix well together for that 4th channel.

If I had to guess, I'd say that the music's using three channels (or making one channel drop out when sound effects are playing), and the sound effects are being mixed in realtime to make the fourth.

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.

Don_Adan 12 June 2012 16:58

Quote:

Originally Posted by phx (Post 822979)
You're sure about that? Reassembling and analyzing the game would take some time. I hoped there were easier options.

Hm? What is your source? Aladdin or EaglePlayer? :)

You can resource only the Protracker player, not full Aladdin game.
You can get resourced Protracker (Aladdin) replay from the WT page:

http://wt.exotica.org.uk

Players section.

Don_Adan 12 June 2012 17:01

Quote:

Originally Posted by Codetapper (Post 823009)
I can't remember where I read it but I believe that 7 voice routine is actually mixing 4 channels into 1, plus the other 3 "normal" channels giving the 7. Presumably the modules use instruments and samples that mix well together for that 4th channel.

TFMX 7V, Hippel 7V or Mugician II, but you must have musician which create tune for these soundformats. These formats are not useful for ingame music and 68000, can be useful for 68020+.

pintcat 13 June 2012 03:22

Quote:

Originally Posted by Don_Adan (Post 823048)
TFMX 7V, Hippel 7V or Mugician II, but you must have musician which create tune for these soundformats. These formats are not useful for ingame music and 68000, can be useful for 68020+.

Interesting. I never noticed this before, but you're right. I just opened DeliTracker's ModuleInfo for Turrican II & III and - voilĂ  - they use the 7 voice technique only for the title, end-part and other menu related stuff while the in-game soundtrack uses a simple 4 channel player. During the game the music uses mostly 3 channels. The 4th is either playing sporadic samples or remains completely unused. This is how they got the sound effects into the game without destroying the music.
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.

phx 13 June 2012 09:27

Quote:

Originally Posted by Don_Adan (Post 823047)
You can get resourced Protracker (Aladdin) replay from the WT page:

http://wt.exotica.org.uk

Players section.

There is a single Protracker player on this page. Is it what you mean?

daxb 13 June 2012 12:24

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

Don_Adan 13 June 2012 14:44

Quote:

Originally Posted by phx (Post 823131)
There is a single Protracker player on this page. Is it what you mean?

Yes, but this version (based on Aladdin replay) has some/many changes, f.e. I removed SFX support. BTW. You can also use Team 17's version of The Player 4.1A replay (Superfrog, Qwak, Alien Breed etc), it has support for SFX too and is PC relative, if I remember right.

Photon 15 June 2012 21:11

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. :)

phx 18 June 2012 10:41

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.

Page generated in 0.04778 seconds with 11 queries