-
Notifications
You must be signed in to change notification settings - Fork 0
API Audio
THE_ORONCO edited this page May 21, 2022
·
2 revisions
Play sfx N (0..63) on CHANNEL (0..3) from note OFFSET (0..31 in notes) for LENGTH notes.
Using negative CHANNEL values have special meanings:
channel no. | description |
---|---|
CHANNEL -1 | (default) to automatically choose a channel that is not being used |
CHANNEL -2 | to stop the given sound from playing on any channel |
N can be a command for the given CHANNEL (or all channels when CHANNEL < 0):
sfx no. | description |
---|---|
N -1 | to stop sound on that channel |
N -2 | to release sound on that channel from looping |
SFX(3) -- PLAY SFX 3
SFX(3,2) -- PLAY SFX 3 ON CHANNEL 2
SFX(3,-2) -- STOP SFX 3 FROM PLAYING ON ANY CHANNEL
SFX(-1,2) -- STOP WHATEVER IS PLAYING ON CHANNEL 2
SFX(-2,2) -- RELEASE LOOPING ON CHANNEL 2
SFX(-1) -- STOP ALL SOUNDS ON ALL CHANNELS
SFX(-2) -- RELEASE LOOPING ON ALL CHANNELS
Play music starting from pattern N (0โฆ63) N -1 to stop music
FADE_LEN is in ms (default: 0). So to fade pattern 0 in over 1 second:
MUSIC(0, 1000)
CHANNEL_MASK specifies which channels to reserve for music only. For example, to play only on channels 0..2:
MUSIC(0, NIL, 7) -- 1 | 2 | 4
Reserved channels can still be used to play sound effects on, but only when that channel index is explicitly requested by SFX().
- ๐ Keys
- ๐ Hello World
- ๐พ Example Cartridges
- ๐ File System
โคด๏ธ Loading and Saving- ๐ Using an External Text Editor
- ๐ฝ Backups
- ๐ง Configuration
- ๐ธ Screenshots and GIFs
- ๐ Sharing Cartridges
- ๐ SPLORE
- ๐ผ๏ธ Sprite Sheet / Label (.png)
- ๐ต SFX and Music (.wav)
- ๐ค MAP and CODE
- ๐พ Cartridges (.p8, .p8.png, .p8.rom)
- ๐ Web Applications (.html)
- ๐ค Binary Applications (.bin)
- ๐น๏ธ Uploading to itch.io
- ๐พ Exporting Multiple Cartridges
- ๐ฅ Running EXPORT from the host operating system