Log In  

Cart #bejuyasero-0 | 2023-02-25 | Code ▽ | Embed ▽ | No License
2

Hello.

I have noticed this sample program I wrote does not play 2-notes blending, one after another. No, it cuts off the first one and then plays the new one - despite being on an entirely different channel.

@zep, I think this qualifies as an error. Could you fix it, please ?

P#126291 2023-02-25 21:50

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

P#126305 2023-02-26 02:44

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 ?

P#126307 2023-02-26 03:56

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

P#126308 2023-02-26 04:07 ( Edited 2023-02-26 04:10)

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.

P#126317 2023-02-26 13:58 ( Edited 2023-02-26 14:01)
1

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.

P#126323 2023-02-26 18:37

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.

P#126325 2023-02-26 19:50

[Please log in to post a comment]