Skip to content

Playlist

Playlist

FL Studio built-in module.

Allows you to control and interact with the FL Studio Playlist.

Note

deselectAll()

Deselect all tracks on the playlist

Included since API version 12

getDisplayZone()

Returns the current display zone in the playlist or zero if none.

The display zone is the rectangular region for which a controller is active in performance mode, indicated by a red rectangle on the playlist.

This value can be set using playlist.liveDisplayZone().

Returns

  • int: current display zone.

Included since API version 1.

getLiveBlockColor(index, blockNum)

Returns the color for block blockNum within the track at index.

Note that colors can be split into or built from components using the functions provided in the utils module.

Args

  • index (int): track index.

  • blockNum (int): block number.

Returns

  • int: block color (0x--BBGGRR).

Included since API version 1.

getLiveBlockStatus(index, blockNum, mode=midi.LB_Status_Default)

Returns the live block status for block blockNum within the track at index.

This can be used to determine if this block is playing or scheduled.

Args

  • index (int): track index.

  • blockNum (int): block number.

  • mode (int, optional): live status mode. Defaults to 'LB_Status_Default'.

Returns

Included since API version 1.

getLiveLoopMode(index)

Get the loop mode of the given track.

This value reflects the value in the "motion" section in the performance menu of the track.

Args

  • index (int): track index.

Returns

  • int: live loop mode:

    • 0 (LiveLoop_Stay): Stay.

    • 1 (LiveLoop_OneShot): One shot.

    • 2 (LiveLoop_MarchWrap): March and wrap.

    • 3 (LiveLoop_MarchStay): March and stay.

    • 4 (LiveLoop_MarchStop): March and stop.

    • 5 (LiveLoop_Random): Random.

    • 6 (LiveLoop_ExRandom): Exclusive random (play all clips on the track before playing anything again).

Included since API version 1.

getLivePosSnap(index)

Get the position sync mode of the given track.

This value reflects the value in the "position sync" section in the performance menu of the track.

Args

  • index (int): track index.

Returns

  • int: live position snap:

    • 0 (LiveSnap_Off): No snap.

    • 1 (LiveSnap_Fourth): 1/4 beat.

    • 2 (LiveSnap_Half): 1/2 beat.

    • 3 (LiveSnap_One): 1 beat.

    • 4 (LiveSnap_Two): 2 beats.

    • 5 (LiveSnap_Four): 4 beats.

    • 6 (LiveSnap_Auto): Auto.

Included since API version 1.

getLiveStatus(index, mode=midi.LB_Status_Default)

Returns the live status for track at index.

This can be used to determine if there are any blocks playing or scheduled.

Args

  • index (int): track index.

  • mode (int, optional): live status mode. Defaults to 'LB_Status_Default'.

Returns

Included since API version 1.

getLiveTrigSnap(index)

Get the trigger sync mode of the given track.

This value reflects the value in the "trigger sync" section in the performance menu of the track.

Args

  • index (int): track index.

Returns

  • int: live position snap:

    • 0 (LiveSnap_Off): No snap.

    • 1 (LiveSnap_Fourth): 1/4 beat.

    • 2 (LiveSnap_Half): 1/2 beat.

    • 3 (LiveSnap_One): 1 beat.

    • 4 (LiveSnap_Two): 2 beats.

    • 5 (LiveSnap_Four): 4 beats.

    • 6 (LiveSnap_Auto): Auto.

Included since API version 1.

getLiveTriggerMode(index)

Get the trigger mode of the given track.

This value reflects the value in the "press" section in the performance menu of the track.

Args

  • index (int): track index.

Returns

  • int: live trigger mode:

    • 0 (LiveTrig_Retrigger): Retrigger.

    • 1 (LiveTrig_Hold): Hold and stop.

    • 2 (LiveTrig_HMotion): Hold and motion.

    • 3 (LiveTrig_Latch): Latch.

Included since API version 1.

getPerformanceModeState()

Returns whether FL Studio's performance mode is enabled.

Returns

  • bool: whether performance mode is enabled.

Included since API Version 21.

getSongStartTickPos()

Returns the number of ticks before the "song start" marker (which marks the end of the performance mode section).

WARNING

  • This function is undocumented.

Returns

  • int: number of ticks before the "song start" marker.

Included since API Version ???

getTrackActivityLevel(index)

Returns the activity level of the track at index. This value is either 0.0 or 0.5, representing whether an unmuted playlist clip is active at the playhead.

Compare to playlist.getTrackActivityLevelVis(), which returns a "visual activity level" that takes the time since the most recent note-on event into account.

Args

  • index (int): track index

Returns

  • float: activity level

    • 0.0: No clip is active

    • 0.5: A clip is active at the play head

Notes

  • This function will only return 0.0 or 0.5, and nothing in between. There is no documentation for whether this is by design.

Included since API version 1

getTrackActivityLevelVis(index)

Returns the visual activity level of the track at index. This value is a float in the range of 0.0 - 1.0 representing whether an unmuted playlist clip is active at the playhead and how recently a note-on event was played on this track.

Compare to playlist.getTrackActivityLevel(), which just returns whether there is an active clip at that playhead.

Args

  • index (int): track index

Returns

  • float: activity level

    • 0.0: No clip is active

    • 0.5 - 1.0: A clip is active at the play head. Higher values represent more recent note-on events.

Included since API version 1

getTrackColor(index)

Returns the color of the track at index

Note that colors can be split into or built from components using the functions provided in the module utils.

Note that playlist track indexes start at 1.

Args

  • index (int): track index

Returns

  • int: track color (0x--BBGGRR)

Included since API version 1

getTrackName(index)

Returns the name of the track at index

For unnamed tracks, returns "Track n" where n is index + 1

Note that playlist track indexes start at 1.

Args

  • index (int): track index

Returns

  • str: track name

Included since API version 1

getVisTimeBar()

Returns the current bar number, as shown in the song position panel.

Returns

  • int: time bar.

Included since API version 1.

getVisTimeStep()

Returns the step number within the song, as shown in the song position panel.

Returns

  • int: time step.

Included since API version 1.

getVisTimeTick()

Returns the tick number within the song, as shown in the song position panel.

Returns

  • int: time tick.

Included since API version 1.

incLiveLoopMode(index, value)

Increase live loop mode for track at index.

This is used to cycle through modes in the "motion" section of the track's performance menu.

Args

  • index (int): track index.

  • value (int): delta amount to change loop mode by.

Included since API version 1.

incLivePosSnap(index, value)

Increase live position snap for track at index.

This is used to cycle through modes in the "position sync" section of the track's performance menu.

Args

  • index (int): track index.

  • value (int): delta amount to change position snap mode by.

Included since API version 1.

incLiveTrigMode(index, value)

Increase live trigger mode for track at index.

This is used to cycle through modes in the "press" section of the track's performance menu.

Args

  • index (int): track index.

  • value (int): delta amount to change trigger mode by.

Included since API version 1.

incLiveTrigSnap(index, value)

Increase live trigger snap for track at index.

This is used to cycle through modes in the "trigger sync" section of the track's performance menu.

Args

  • index (int): track index.

  • value (int): delta amount to change trigger snap mode by.

Included since API version 1.

isTrackMuteLock(index)

Returns whether the mute status of the track at index is locked (meaning that solo/unsolo commands won't affect its mute status).

Args

  • index (int): track index

Returns

  • bool: whether track's mute status is locked

Included since API version 2

isTrackMuted(index)

Returns whether the track at index is muted

Args

  • index (int): track index

Returns

  • bool: whether track is muted

Included since API version 1

isTrackSelected(index)

Returns whether the track at index is selected

Args

  • index (int): track index

Returns

  • bool: whether track is selected

Included since API version 12

isTrackSolo(index)

Returns whether the track at index is solo

Args

  • index (int): track index

Returns

  • bool: whether track is muted

Included since API version 1

liveBlockNumToTime(index)

Returns the number of ticks before the live block marker at index.

WARNING

  • This function is undocumented.

Args

  • index (int): index of live block marker.

Returns

  • int: number of ticks.

Included since API Version ???

liveDisplayZone(left, top, right, bottom, duration=0)

Set the display zone in the playlist to the specified co-ordinates. Use the optional duration parameter to make display zone temporary.

Args

  • left (int): the zero-indexed position of the time marker from which to begin the display zone highlight.

  • top (int): the one-indexed track number from which to begin the display zone highlight.

  • right (int): the zero-indexed position of the time marker from which to end the display zone highlight. The highlight will go up to this marker, but will not include it.

  • bottom (int): the one-indexed track number from which to end the display zone highlight. The highlight will go up to, and will include this track.

  • duration (int, optional): duration for which to show the display zone highlight in ms. Defaults to 0, for infinite duration.

Included since API version 1.

liveTimeToBlockNum(time)

Returns the block number that a time (in ticks) is associated with in live performance mode.

Note

  • The first tick of each block is counted as part of the previous block. For example, if block 1 starts at tick 384, liveTimeToBlockNum(384) will return 0, but liveTimeToBlockNum(385) will return 1.

  • This is likely a bug.

WARNING

  • This function is undocumented.

Args

  • time (int): time in ticks.

Returns

  • int: block number (0-indexed).

Included since API Version ???

lockDisplayZone(index, value)

Lock display zone at index.

HELP WANTED

  • Explanation for parameters.

Args

  • index (int): ???

  • value (int): ???

Included since API version 1.

muteTrack(index, value=-1)

Toggle whether the track at index is muted. An unmuted track will become muted and a muted track will become unmuted.

Args

  • index (int): track index

  • value (int, optional): new mute value (1 = mute, 0 = unmute)

Included since API version 1

API changes

  • value parameter added in API v30

muteTrackLock(index)

Toggle whether the track at index's mute status is locked (meaning that solo/unsolo commands won't affect its mute status).

Args

  • index (int): track index

Included since API version 2

refreshLiveClips(*args)

Refresh live clips for track at index.

HELP WANTED:

  • What does this do?

This function appears to work, even when given no arguments.

Args

  • index (int): track index.

  • value (int): ???

Included since API version 1.

scrollTo(a, b, c, d)

Scroll to the given location?

WARNING

  • This function is undocumented.

Args

  • a (int): ???

  • b (int): ???

  • c (int): ???

  • d (int): ???

Included since API Version ???

selectAll()

Select all tracks on the playlist

Included since API version 12

selectTrack(index)

Toggle whether the track at index is selected. A deselected track will become selected and a selected track will become deselected.

Args

  • index (int): track index

Included since API version 12

setTrackColor(index, color)

Sets the color of the track at index

Note that colors can be split into or built from components using the functions provided in the module utils.

Note that playlist track indexes start at 1.

Args

  • index (int): track index

  • color (int): track color (0x--BBGGRR)

Included since API version 1

setTrackName(index, name)

Sets the name of the track at index

Setting the name to an empty string ("") will reset the name to "Track n"

Note that playlist track indexes start at 1.

Args

  • index (int): track index

Included since API version 1

soloTrack(index, value=-1, inGroup=False)

Toggle whether the track at index is solo. An unsolo track will become solo and a solo track will become unsolo. If value is provided, it will control what the new value will be (1: solo, 0: unsolo).

The inGroup parameter determines whether tracks in the same group are also soloed. For example, if tracks 2 and 3 are grouped under track 1, soloing any of them with inGroup=True will solo all of them.

Args

  • index (int): track index

  • value (int, optional): new solo value

  • inGroup (bool, optional): solo track within track group

Included since API version 1

API changes

  • inGroup parameter introduced in API version 30

trackCount()

Returns the number of tracks on the playlist.

Includes empty tracks.

Returns

  • int: track count on playlist

Included since API version 1

triggerLiveClip(index, subNum, flags, velocity=-1)

Triggers live clip for track at index and for block subNum.

Args

  • index (int): track index.

  • subNum (int): block number (usually blockNum), or -1 to stop live clips on this track.

  • flags (int): live clip trigger flags. Refer to FL Studio manual.

  • velocity (int, optional): velocity for triggering clip. Defaults to -1.

Included since API version 1.