Module Musician.Song

Song class

Class Musician.Song

Musician.Song.GetPlayingSongCount () Return the number of songs currently playing
Musician.Song.GetPlayingSongs () Return songs currently playing
Musician.Song.OnUpdate (elapsed) Main on frame update function
Musician.Song.UnpackChunkData (data) Unpack song chunk data
Musician.Song.UnpackChunkHeader (data) Unpack song chunk header
Musician.Song:AppendChunk (chunk, mode, songId, chunkDuration, playtimeLeft, player) Append chunk data to current song
Musician.Song:CancelImport () Cancel current import
Musician.Song:Clone () Clone song
Musician.Song:ConvertToLive () Convert song to live mode.
Musician.Song:GetId () Return song ID
Musician.Song:GetProgression () Return playing progression
Musician.Song:Import (data, crop[, previousProgression=0[, onComplete]]) Import song from string
Musician.Song:ImportFromBase64 (base64data, crop[, onComplete]) Import song from a base 64 encoded string
Musician.Song:IsAudible () Returns true when the song is being played and can be heard
Musician.Song:IsPlaying () Return true if the song is playing or about to be played (preloading).
Musician.Song:NoteOff (track, key, audioOnly[, decay]) Stop a note of a track
Musician.Song:NoteOn (track, noteIndex, retries) Play a note
Musician.Song:OnImportError () Handle importing error
Musician.Song:PackChunk (chunk) Pack a song chunk
Musician.Song:Play (delay) Play song
Musician.Song:PlayOnFrame (elapsed) Play notes accordingly to every frame.
Musician.Song:Reset () Reset song to initial position
Musician.Song:Resume (eventSent) Resume a song playing
Musician.Song:Seek (cursor) Seek to position
Musician.Song:SetTrackMuted (track, isMuted) Mute or unmute track
Musician.Song:SetTrackSolo (track, isSolo) Set/unset track solo
Musician.Song:SongNotesOff () Stop all notes of the song
Musician.Song:Stop () Stop song
Musician.Song:StopStreaming () Stop streaming song
Musician.Song:Stream () Stream song
Musician.Song:StreamOnFrame (elapsed) Stream a chunk of the song on frame
Musician.Song:TrackIsMuted (track) Return true if the track is muted
Musician.Song:TrackNotesOff (track, audioOnly) Stop all notes of a track


Class Musician.Song

Song class
Musician.Song.GetPlayingSongCount ()
Return the number of songs currently playing

Returns:

    playingSongCount (int)
Musician.Song.GetPlayingSongs ()
Return songs currently playing

Returns:

    playingSongCount (int)
Musician.Song.OnUpdate (elapsed)
Main on frame update function

Parameters:

  • elapsed (number)
Musician.Song.UnpackChunkData (data)
Unpack song chunk data

Parameters:

  • data (string)

Returns:

    chunk (table)
Musician.Song.UnpackChunkHeader (data)
Unpack song chunk header

Parameters:

  • data (string)

Returns:

  1. mode (int)
  2. songId (int)
  3. chunkDuration (number)
  4. playtimeLeft (number)
  5. position (table) player position and GUID
  6. trackCount (int)
  7. headerLength (number)
Musician.Song:AppendChunk (chunk, mode, songId, chunkDuration, playtimeLeft, player)
Append chunk data to current song

Parameters:

  • chunk (table)
  • mode (number)
  • songId (number)
  • chunkDuration (number)
  • playtimeLeft (number)
  • player (string)
Musician.Song:CancelImport ()
Cancel current import
Musician.Song:Clone ()
Clone song

Returns:

    song (Musician.Song)
Musician.Song:ConvertToLive ()
Convert song to live mode. For testing only
Musician.Song:GetId ()
Return song ID

Returns:

    songId (int)
Musician.Song:GetProgression ()
Return playing progression

Returns:

    progression (number)
Musician.Song:Import (data, crop[, previousProgression=0[, onComplete]])
Import song from string

Parameters:

  • data (string)
  • crop (boolean) Automatically crop song to first and last note
  • previousProgression (number) Add previous progression (0-1) (default 0)
  • onComplete (function) Called when the whole import process is complete. Argument is true when successful (optional)
Musician.Song:ImportFromBase64 (base64data, crop[, onComplete])
Import song from a base 64 encoded string

Parameters:

  • base64data (string)
  • crop (boolean) Automatically crop song to first and last note
  • onComplete (function) Called when the whole import process is complete. Argument is true when successful (optional)
Musician.Song:IsAudible ()
Returns true when the song is being played and can be heard

Returns:

    isAudible (boolean)
Musician.Song:IsPlaying ()
Return true if the song is playing or about to be played (preloading).

Returns:

    isPlaying (boolean)
Musician.Song:NoteOff (track, key, audioOnly[, decay])
Stop a note of a track

Parameters:

  • track (table) Reference to the track
  • key (int) Note key
  • audioOnly (boolean) Stop note audio only
  • decay (number) Override instrument decay (optional)
Musician.Song:NoteOn (track, noteIndex, retries)
Play a note

Parameters:

  • track (table) Reference to the track
  • noteIndex (int) Note index
  • retries (int) Number of attempts to recover dropped notes
Musician.Song:OnImportError ()
Handle importing error
Musician.Song:PackChunk (chunk)
Pack a song chunk

Parameters:

  • chunk (table)

Returns:

    data (string)
Musician.Song:Play (delay)
Play song

Parameters:

  • delay (number) Delay in seconds to wait before playing the song
Musician.Song:PlayOnFrame (elapsed)
Play notes accordingly to every frame.

Parameters:

  • elapsed (number)
Musician.Song:Reset ()
Reset song to initial position
Musician.Song:Resume (eventSent)
Resume a song playing

Parameters:

  • eventSent (boolean)
Musician.Song:Seek (cursor)
Seek to position

Parameters:

  • cursor (number)
Musician.Song:SetTrackMuted (track, isMuted)
Mute or unmute track

Parameters:

  • track (table)
  • isMuted (boolean)
Musician.Song:SetTrackSolo (track, isSolo)
Set/unset track solo

Parameters:

  • track (table)
  • isSolo (boolean)
Musician.Song:SongNotesOff ()
Stop all notes of the song
Musician.Song:Stop ()
Stop song
Musician.Song:StopStreaming ()
Stop streaming song
Musician.Song:Stream ()
Stream song
Musician.Song:StreamOnFrame (elapsed)
Stream a chunk of the song on frame

Parameters:

  • elapsed (number)
Musician.Song:TrackIsMuted (track)
Return true if the track is muted

Parameters:

  • track (table)

Returns:

    isMuted (boolean)
Musician.Song:TrackNotesOff (track, audioOnly)
Stop all notes of a track

Parameters:

  • track (table) Reference to the track
  • audioOnly (boolean)
generated by LDoc 1.4.6 Last updated 2020-08-09 19:40:05