kitao / pyxel

A retro game engine for Python
MIT License
15.31k stars 847 forks source link

Slide sound effect only works once #520

Closed fgallaire closed 8 months ago

fgallaire commented 9 months ago
pyxel.sounds[0].set("e2", "p", "3", "s", 20)
pyxel.play(0, pyxel.sounds[0])
pyxel.play(0, pyxel.sounds[0])

The sound is played "Slide" only once then is played "None".

fgallaire commented 9 months ago

When playing an other sound with "Slide" effect it doesn't work neither. Only changing the channel makes the "Slide" effect works once again.

kitao commented 8 months ago

The effect of the slide effect is to smoothly connect the sound that was played before with the next sound. Therefore, the effect will not occur unless two pitches are played. (Since there is no previous sound on the first time, it will slide from the lowest pitch.)

fgallaire commented 8 months ago

Thanks for the explanation. As it's not obvious, maybe something to add in the documentation ?

kitao commented 8 months ago

In the latest Pyxel, the slide effect works only for the second and later notes now. I'll think about modifying documents when I remake the official API reference (it's the next major change in Pyxel 2.x)