Edit Page
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 11: | Line 11: | ||
The <code>sfx()</code> function plays a sound on one of PICO-8's four sound channels. If an explicit channel number is not specified, PICO-8 will attempt to select a channel automatically, giving priority to an unused channel so that two concurrent sounds may overlap. |
The <code>sfx()</code> function plays a sound on one of PICO-8's four sound channels. If an explicit channel number is not specified, PICO-8 will attempt to select a channel automatically, giving priority to an unused channel so that two concurrent sounds may overlap. |
||
β | If music is currently playing, the sound effect will attempt to honor the ''channel mask'' set by the call to the [[Music| |
+ | If music is currently playing, the sound effect will attempt to honor the ''channel mask'' set by the call to the [[Music|music()]] function to avoid channels that are important to the music. If you specify an explicit channel to <code>sfx()</code>, the music's channel mask is ignored. |
It's possible to detect the current sfx being played for each channel, along with the index of the current note of each sfx. See [[Stat#.7B16.E2.80.A626.7D_Sound_and_music_status|<code>stat(16..23)</code>]] for details. |
It's possible to detect the current sfx being played for each channel, along with the index of the current note of each sfx. See [[Stat#.7B16.E2.80.A626.7D_Sound_and_music_status|<code>stat(16..23)</code>]] for details. |