PICO-8 Wiki
Edit Page
Sfx
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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|<code>music()</code>]] 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.
+
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.
Please note that all contributions to the PICO-8 Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)

Template used on this page: