I'm not quite sure what's going on, if you fill the channels every frame the channel handling sorta lags and you can have 2 at once before it's corrected, I could've sworn I had the same sfx being played multiple times in different starting positions and lengths but it might've been just the sfx are so fast most of the time it works out.
To be fair sfx(0, -1) doesn't even try to fill the other channels for me so I'm not sure if using the same sfx in different channels ever was allowed outside of a pattern, I think that was the case at least.. not sure how the synth handles it under the hood if it's intended or not
Hi @SmellyFishstiks:
I think what it is, quite simply you cannot play the same SFX on different channels. And that shouldn't be right. Where did the polyphonic playing go ?
music()? (though of course that adds a whole layer other of problems) sfx loaded channel handling and music loaded channel handling are different. I think it's meant to be this way but it's still not clear to me why exactly and changing it would break some stuff maybe
I agree, this does seem like it ought to work. I downloaded the cart and copied sfx 0 to 1 and then had the code play sfx 0 at tim=0 and sfx 1 at tim=24 and they did overlap correctly.
It's like each sfx only has just one state block or something, instead of one for each channel it could be played on.
Kind of a major bug and I'm surprised it hasn't surfaced before. Maybe there's something peculiar to this exact arrangement that causes it and doesn't cause it otherwise, but I tried changing the sfx length and speed and a couple of other factors, and really, it seems the same every time.
I did the same checks and suspected it's due to the 3=Drop effect since it has special behaviours (like restarting a looped custom instruments sequence iirc?) so tried with slide and fades but still the same.
So yes it 'could' look like an abnormal behaviour.
@Felice We probably never noticed since it's quite rare to have such a slow speed on one sfx.
Doubt:
But what if this is "fixed"? 🤔 I can imagine a few negative consequences: several shmup games and other carts using repeated same sfx suddenly overlapping (and possibly amplifying) sounds and making audio more annoying or distorted?
We probably never noticed because we unconsciously liked how it works now (and it's likely Zep made it like that by design?)
Just a thought I liked to share.
Hi @Felice and @Heracleum:
Heracleum, as long as the carts use a dedicated channel then the sound should not overlap. That's the purpose of the channels.
If someone made a game and used code, say: sfx(34)
without assigning it a channel. The normal behavior SHOULD allow overlap and play in the next unused channel.
However if you used, sfx(34,1)
then playing this sound should overwrite any current channel 1 in use and then play the sound there.
You are quite right it might have some negative consequences. However that would mean the code would need to be corrected - to be forced into a channel as intended if they do not way amplification or distortion.
It could also be something optional via _extcmd("overlaysfx")
I suppose. I'm just looking at the logic of the command - and I have a need to play a single SFX more than once, especially since I am forcing each play into a new channel.
I believe - it should work. And I'm calling it out as a bug until a compromise is made.
Error has code make that sfx like a kick no but sounds like werid
function _init() cls() tim=0 chan=0 end function _update() if tim==0 or tim==24 then sfx(0,chan) chan=chan+1 end tim=tim+1 end |
[Please log in to post a comment]