Multiple samples on one channel
Why MMF2 does not support multiple samples on one channel? I just would like to play all the "normal" samples on channel 1 ja music on channel 2. It would be easy to hande the volume.
And if I just set "Play sample" and then set main volume 25 it plays well. But if I now set music to play on channel 2 and it's volume to 100 it's very quite.
And even if I set sample.wav volume to 25 and:
Every 1:00 -> Play sample "sample.wav" it sometimes plays with 25 and sometimes with 100. Bug?
Re: Multiple samples on one channel
There are 32 channels for this reason, when you use the play sample function it just finds the next free channel. This is a intentional functionality I believe.
Also if you set the volume AFTER the play event then it works every time:
Every 1:00 ->
Play Sample "sample.wav"
Set Volume "same.wav" to 25
Re: Multiple samples on one channel
"Every 1:00 ->
Play Sample "sample.wav"
Set Volume "same.wav" to 25"
That didn't helped. The volume is sometimes 25 and sometimes 100. But if there is only 32 channels, it means I can use only 32 samples?
EDIT: And what then If I use weapon's sample on channel 1. It repeats the sample every 0:10 and it does not work very well.
Re: Multiple samples on one channel
You should lock a specific channel, set the volume of this channel to 25 and play this sample on this channel. The other Play Sample actions will ignore this channel when they look for a free channel.
Quote:
It repeats the sample every 0:10 and it does not work very well
That's quite a short duration, maybe you could add a blank at the end of the sample and set the sample to loop?
Otherwise check the format of the sample : if it's a .ogg sample convert it to .wav format, .wav files use less CPU resources than OGG files, it's better for small samples.
Re: Multiple samples on one channel
I mean if I just shoot every 0:10 and it plays a weapons fire sample. It does not have time to finish the first sample untill the second comes.
See my example:
www.ferror.net/temp/sound.mfa
Re: Multiple samples on one channel
Ah yes, in this case you have to use the normal Play Sample action so that it can play the sound on several channels at the same time.
Re: Multiple samples on one channel
Could you add an action "Play sample on channel range" which plays the sample in the first empty slot or oldest slot in the given range?
Perhaps also a "play sample at specific volume" action (deprecating the old one?), to avoid having to specifically specify the channel in order to set the volume of the sample.
Re: Multiple samples on one channel
Dynasoft has good ideas. But anyway my problem is still there. If I use play sample I can not set volume. And even if I set main volume to 25 the music channel (2) is too low.
Re: Multiple samples on one channel
Quote:
Originally Posted by Yves
You should lock a specific channel, set the volume of this channel to 25 and play this sample on this channel. The other Play Sample actions will ignore this channel when they look for a free channel.
Now I understand why I failed when I tried to create a simple routine for player-defined sound volume. I looped through all channels at start of frame and set the volume the player had adjusted in main menue - but without locking samples to specific channels :)
Jarzka, maybe you could simply set a flag while player is shooting. Then set sound on/off accordingly.
Flag=ON and Shooting.wav not playing -> play the wav
Flag=OFF -> Stop sample
This way you could also use a sample with multiple shots/longer duration on a single channel with defined volume setting. And it's better than an Every 0:10 event.
Re: Multiple samples on one channel
To be really honest, it's a design flaw that a sample volume is set after it have started to play. I know that MMF2 does start to play a sound instantly when the 'play sample' action is triggered, and since a small part (a millisecond) can have been played before the 'set sample volume' action is triggered (even if it's the following action in the event), you can clearly hear a digital 'pop'. I've had this problem, and I've been forced to always set a channel volume, then play a sound on that specific channel.
To get the best sounding results, all the properties (volume, pan, sample rate) must be set the moment the sample starts.
As Dynasoft said, a 'play sample at specific volume' would be good, but I think there should be a 'play sample with [volume] [pan] [sample rate (-1 = no change)] [repeat count (-1 = infinite, 0 = no repeat, 1 = repeat 1 time, etc...)]
Re: Multiple samples on one channel
I dunno. I would need to do a lot of adjusting. The easiest way to solve this would be command "Play sample with X volume".
And how long should I wait it? Months? Years?
Re: Multiple samples on one channel
Months... at least :) maybe years... :(
Re: Multiple samples on one channel
Is this a windows related issue?
I only ask because direct show seems to behave the same way
Dave