Skip to content
Josh Goebel edited this page Oct 7, 2021 · 18 revisions

music

This function was enhanced in version 0.90.

music [track=-1] [frame=-1] [row=-1] [loop=true] [sustain=false] [tempo=-1] [speed=-1]

...or to stop the music:

music

Parameters

  • track : the id of the track to play from (0..7)
  • frame : the index of the frame to play from (0..15)
  • row : the index of the row to play from (0..63)
  • loop : loop music (true) or play it once (false)
  • sustain : sustain notes after the end of each frame or stop them (true/false)
  • tempo : play track with the provided tempo, (added in version 0.90)
  • speed : play track with the provided speed, (added in version 0.90)

Description

This function starts playing a track created in the Music Editor.

Caveats

Remember, that TIC runs 6o times per second. When you're changing the state of your music inside TIC you'll may need to keep track of the status manually.

An example:

soundtrack = false

function TIC()
    -- check that we only start the music a single time
    if not soundtrack then
        music(0)
        soundtrack = "intro"
    end
end
Clone this wiki locally