Log In  
Follow
ch32
[ :: Read More :: ]

Hello, i've playing with pico-8 for quite a long time and is great, i really like this piece of software

the issue: when i try to play two sounds at the same time using the sfx command, despite specifying different channels in the parameter, one sound cuts the other, for example:

sfx(0, 0, 0, 1) --plays only the first note from the first sfx page on channel 0
sfx(0, 1, 2, 1) --plays only the third note from the first sfx page on channel 1

the first sfx page:

(result: the sounds overlaps eachother, instead of mixing them despite being on different channels)

but if the second sound i'm trying to play comes from a different sfx page, the sounds mixes without any problem

sfx(0, 0, 0, 1) --plays only the first note from the first sfx page on channel 0
sfx(1, 1, 0, 1) --plays only the first note from the second sfx page on channel 1

the second sfx page:

(result: the two sounds are played at the same time, no overlap)

why is the channel parameter ignored in the first example? if is specified, it should play the note on the assigned channel and thus, mix the two sounds like in the second example, instead of overlaping them.

now, why i'm taking this approach? i'm trying to create a rhythm game, beatmania/djmax style, after sequencing the first two channels of a 2 minute song, is obvious that only one song with only one chart is going to be available to play.

instead, i'm trying to use the sfx pages as a keysound storage, and use tables to save the song info, and see if i can at least have 3 songs available with different charts and have a more precise bpm, since the game won't use much code/variables.

please let me know if this can be fixed or if it requires too much work, other approach i can use is with the peek/poke commands to patch the song in runtime and hijack the notes the user must press, this could work to add more charts but still would be only one song or have several songs with lots of repetitive note patterns.

Thanks in advance!

P#95083 2021-07-20 03:58 ( Edited 2021-07-21 04:38)