Mixer
Mixer
FL Studio built-in module.
Allows you to control and interact with the FL Studio Mixer and effects tracks.
Note
- Mixer tracks are zero-indexed
afterRoutingChanged()
Notify FL Studio that channel routings have changed.
Included since API version 1
armTrack(index)
Toggles whether the track at index is armed for recording.
Args
index
(int
): track index.
Included since API version 1.
automateEvent(index, value, flags, speed=0, isIncrement=0, res=midi.EKRes)
Automate event.
HELP WANTED
- What does this do?
Args
-
index
(int
): ??? -
value
(int
): ??? -
flags
(int
): refer to the FL Studio manual. -
speed
(int
, optional): ???. Defaults to 0. -
isIncrement
(int
, optional): ???. Defaults to 0. -
res
(float
, optional): ???. Defaults tomidi.EKRes
.
Returns
long
: ???
Included since API version 1.
deselectAll()
Deselects all tracks.
Included since API version 1.
enableTrack(index)
Toggles whether the track at index
is enabled.
Note
- This seems to be functionally identical to
muteTrack()
.
Args
- index (
int
): track index.
Included since API version 1.
enableTrackSlots(index, value=False)
Toggle whether all effects are enabled on a track.
KNOWN ISSUES
- If a
value
isn't supplied, the value will be set toFalse
rather than toggled.
Note
- Although there is no visual indication, this can be used to toggle effects for empty tracks, leading to effects users add in the future not doing anything.
Args
-
index
(int
): Track index. -
value
(bool
): Whether effects should be enabled or not.
Included since API Version 19.
focusEditor(index, plugIndex)
Focus the editor the effect plugin at the given location.
Args
-
index
(int
): track index of plugin. -
plugIndex
(int
): mixer slot index of plugin.
Included since API Version 25.
getActiveEffectIndex()
Returns the index of the active effects plugin, or None if there isn't one.
Returns
tuple[int, int]
:(index, plugIndex)
, orNone
.
Included since API Version 25.
getAutoSmoothEventValue(index, locked=1)
Returns auto smooth event value.
HELP WANTED
- What does this do?
Args
-
index
(int
): ??? -
locked
(int
, optional): ???. Defaults to 1.
Returns
int
: ???
Included since API version 1.
getCurrentTempo(asInt=False)
Returns the current tempo of the song.
Args
asInt
(bool
, optional): whether to return the tempo as anint
(True
) or not (False
). Defaults toFalse
.
Returns
int
orfloat
: Current tempo.
Included since API version 1.
getEventIDName(index, shortname=0)
Returns event name for event at index
.
HELP WANTED
- What does this do?
Args
-
index
(int
): ??? -
shortname
(int
, optional): ???. Defaults to 0.
Returns
str
: name of event?
Included since API version 1.
getEventIDValueString(index, value)
Returns event value as a string.
HELP WANTED
- What does this do?
Args:
-
index
(int
): ??? -
value
(int
): ???
Returns
str
: ???
Included since API version 1.
getEventValue(index, value=midi.MaxInt, smoothTarget=1)
Returns event value from MIDI.
HELP WANTED
- What does this do?
Args
-
index
(int
): ??? -
value
(int
, optional): ???. Defaults to 'MaxInt'. -
smoothTarget
(int
, optional): ???. Defaults to 1.
Returns
int
: ???
Included since API version 1.
getLastPeakVol(section)
Returns last peak volume.
Args
-
section
(int
): audio channel-
0
: left channel. -
1
: right channel.
-
Returns
float
: last peak volume (0.0
for silence,1.0
for 0 dB,>1.0
for clipping).
Included since API version 9.
getRecPPS()
Returns the recording PPS.
This value is determined by the the timebase (PPQ) value of the current project.
Returns
int
: recording PPS.
Included since API version 1.
getRouteSendActive(index, destIndex)
Return whether the track at index
is routed to the track at destIndex
Args
-
index
(int
): source track -
destIndex
(int
): destination track
Returns
bool
: whether the tracks are routed
Included since API version 1
getSlotColor(index, slot)
Returns the color of a mixer track FX slot.
Note that colors can be split into or built from components using the functions provided in the utils module.
Args
-
index
(int
): mixer track index. -
slot
(int
): mixer track FX slot index.
Returns
int
: color of mixer track FX slot.
Included since API Version 32.
getSongStepPos()
Returns the current position in the song, measured in steps.
Returns
int
: song position.
Included since API version 1.
getSongTickPos(mode=midi.ST_Int)
Returns the current position in the song, measured in ticks.
Args
mode
(int
, optional): the format to return the tick position in. See the FL Studio manual.
Returns
int
orfloat
: song position in ticks.
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 utils module.
Args
index
(int
): track index.
Returns
int
: color of track (0x--BBGGRR).
Included since API version 1.
getTrackDockSide(index)
Returns the dock side of the mixer for track at index
.
Args
index
(int
): track index.
Returns
-
int
: docking side:-
0
: Left. -
1
: Center (default). -
2
: Right.
-
Included since API version 13.
getTrackInfo(mode)
Returns the index of a special mixer track depending on mode
.
This function can serve to help potentially future-proof scripts by ensuring that they continue to use the correct indexes for mixer tracks.
Args
-
mode
(int
): Determines the type of information provided.-
TN_Master
(0
): Index of master track. -
TN_FirstIns
(1
): Index of first insert track. -
TN_LastIns
(2
): Index of last insert track. -
TN_Sel
(3
): Index of the "current" track (the one with the large peak meter docked to the left).
-
Returns
int
: requested track index.
Included since API version 1.
getTrackName(index)
Returns the name of the track at index
.
Args
index
(int
): track index.
Returns
str
: name of track.
Included since API version 1.
getTrackPan(index)
Returns the pan of the track at index
. Pan lies within the range
100% left (-1.0
) - 100% right (1.0
). Note that the default value is
0.0
.
Args
index
(int
): track index.
Returns
float
: pan of track.
Included since API version 1.
getTrackPeaks(index, mode)
Returns the current audio peak value for the track at index
.
Args
-
index
(int
): track index -
mode
(int
): track peaks mode-
0
: left channel -
1
: right channel -
2
: maximum from left and right channels -
Values for inverted peaks are present, but appear to be incorrect.
-
Returns
-
float
: track peak values:-
0.0
: silence -
1.0
: 0 dB -
>1.0
: clipping
-
Included since API version 1
getTrackPluginId(index, plugIndex)
Returns the plugin ID of the plugin on track index
in slot plugIndex
.
A plugin ID is used internally by FL Studio to represent effects present on the mixer. A plugin ID can be used with REC events in order to automate plugins, and is also the return value of ui.getFocusedFormID() if the focused window is an effect plugin.
Plugin IDs are represented as ((track << 6) + index) << 16
, although
the official documentation lists them as (track << 6 + index) << 16
,
which uses the order of operations incorrectly.
Args
-
index (
int
): track index. -
plugIndex (
int
): plugin index.
Returns
int
: plugin ID.
Included since API version 1.
getTrackRecordingFileName(index)
Returns the file name for audio being recorded on the track at index
.
Note
- Files can't be opened in FL Studio's Python interpreter due to disk access being disabled for security reasons.
Args
index
(int
): track index
Returns
str
: filename
Included since API version 1
getTrackStereoSep(index)
Returns the stereo separation of the track at index
. Stereo separation
lies within the range 100% centered (-1.0
) - 100% separated (1.0
). Note
that the default value is 0.0
.
Args
index
(int
): track index.
Returns
float
: stereo separation of track.
Included since API version 12.
getTrackVolume(index, mode=0)
Returns the volume of the track at index
. Volume lies within the range
0.0
- 1.0
. Note that the default value is 0.8
. Use the mode
flag to
get the volume in decibels.
Args
-
index
(int
): track index. -
mode
(int
, optional): whether to return the volume as a value between0
and1
, or in decibels.
Returns
float
: volume of track.
Included since API version 1.
isTrackArmed(index)
Returns whether the track at index
is armed for recording.
Args
index
(int
): track index.
Returns
bool
: whether track is armed.
Included since API version 1.
isTrackAutomationEnabled(index, plugIndex)
Returns whether the plugin at plugIndex
on track at index
has
automation enabled.
Args
-
index
(int
): track index. -
plugIndex
(int
): index of plugin.
Returns
bool
: whether automation is enabled for the track.
Included since API version 1.
isTrackEnabled(index)
Returns whether the track at index
is enabled
Note
- This seems to be functionally identical to
not isTrackMuted()
.
Args
index
(int
): track index.
Returns
bool
: whether track is enabled.
Included since API version 1.
isTrackMuteLock(index)
Returns whether the mute state of the track at index
is locked.
If this is true, the mute status of this track won't change when other tracks are solo or unsolo.
Args
index
(int
): track index.
Returns
bool
: whether track is mute locked.
Included since API version 13.
isTrackMuted(index)
Returns whether the track at index
is muted.
Args
index
(int
): track index.
Returns
bool
: whether track is solo.
Included since API version 2.
isTrackPluginValid(index, plugIndex)
Returns whether a plugin on track index
in slot plugIndex
is valid
(has been loaded, so the slot isn't empty).
Args
-
index
(int
): track index. -
plugIndex
(int
): plugin index.
Returns
bool
: whether track is mute locked
Included since API version 1.
isTrackRevPolarity(index)
Returns whether the polarity is reversed for the track at index
.
Args
index
(int
): track index.
Returns
bool
: whether polarity is inverted.
Included since API Version 19.
isTrackSelected(index)
Returns whether the track at index
is selected.
Args
index
(int
): track index.
Returns
bool
: whether the track is selected.
Included since API version 1.
isTrackSlotsEnabled(index)
Returns whether effects are enabled for a particular track, using the "enable effects slots" button.
Args
index
(int
): track index.
Returns
bool
: whether effects are enabled on the track.
Included since API Version 19.
isTrackSolo(index)
Returns whether the track at index
is solo.
Args
index
(int
): track index.
Returns
bool
: whether track is solo.
Included since API version 1.
isTrackSwapChannels(index)
Returns whether left and right channels are inverted for a particular track.
Args
index
(int
): track index.
Returns
bool
: whether left and right are inverted.
Included since API Version 19.
linkChannelToTrack(channel, track, select=False)
Link the given channel to the given mixer track.
Args
-
channel
(int
): channel index on channel rack (respecting groups). -
track
(int
): mixer track index. -
select
(bool
, optional): whether to select the mixer track. Defaults toFalse
.
Included since API Version 23.
linkTrackToChannel(mode)
Link a mixer track to a channel.
HELP WANTED
- How does this function call work?
Args
-
mode
(int
): link mode-
ROUTE_ToThis
(0
) -
ROUTE_StartingFromThis
(1
)
-
Included since API version 1
muteTrack(index, value=-1)
Toggles whether the track at index is muted.
Args
-
index
(int
): track index. -
value
(int
, optional): the new value for the mute state (1
for mute,0
for unmute). Defaults to-1
(toggle).
Included since API version 2.
remoteFindEventValue(index, flags=0)
Returns event value.
HELP WANTED
- What does this do?
Args
-
index
(int
): ??? -
flags
(int
, optional): ???. Defaults to 0.
Returns
float
: ???
Included since API version 1.
revTrackPolarity(index, value=False)
Inverts the polarity for a particular track.
KNOWN ISSUES
- If a
value
isn't supplied, the value will be set toFalse
rather than toggled.
Args
index
(int
): Index of track to reverse polarity for.value
(bool
): Whether polarity should be swapped or not.
Included since API Version 19.
selectAll()
Selects all tracks.
Included since API version 1.
selectTrack(index)
Toggles whether the track at index
is selected.
Args
index
(int
): track index.
Included since API version 1.
setActiveTrack(index)
Exclusively selects the mixer track at index.
This means any other selected tracks will be deselected.
Args
index
(int
): track index.
Included since API Version 27.
setRouteTo(index, destIndex, value)
Route the track at index
to the track at destIndex
.
Ensure that after all routing changes are made, the afterRoutingChanged()
function is called to allow the UI to update correctly.
Args
-
index
(int
): source track index -
destIndex
(int
): destination track index -
value
(int
): whether to enable the route (1
) or disable it (0
)
Included since API version 1
setSlotColor(index, slot, color)
Sets the color of a mixer track FX slot.
Note that colors can be split into or built from components using the functions provided in the utils module.
Args
-
index
(int
): mixer track index. -
slot
(int
): mixer track FX slot index. -
color (
int
): color of mixer track FX slot.
Included since API Version 32.
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 utils module.
Args
-
index
(int
): track index. -
color
(int
): color of track (0x--BBGGRR).
Included since API version 1.
setTrackName(index, name)
Sets the name of track at index
Setting the name to an empty string will reset the name of the track to its default.
Args
-
index (
int
): index of mixer track. -
name (
str
): new name.
Included since API version 1.
setTrackNumber(trackNumber, flags=0)
Selects the mixer track at trackNumber
.
Note
- All functionality except for scrolling flag can be replicated more easily using mixer.selectTrack().
Args
-
trackNumber
(int
): the track index to select. -
flags
(int
, optional): Options to do with new track selection.-
curfxScrollToMakeVisible
(1
): Scroll to make the newly-selected track visible. -
curfxCancelSmoothing
(2
): Effect unknown. -
curfxNoDeselectAll
(4
): Prevent the deselection of other selected tracks??? Doesn't seem to work. -
curfxMinimalLatencyUpdate
(8
): Effect unknown.
Defaults to
0
. -
Included since API version 1.
setTrackPan(index, pan, pickupMode=midi.PIM_None)
Sets the pan of the track at index
. Pan lies within the range
100% left (-1.0
) - 100% right (1.0
). Note that the default value is
0.0
. Use the pickup mode flag to set pickup options.
Args
-
index
(int
): track index. -
pan
(float
): pan of track. -
pickupMode
(int
, optional): define the pickup behavior. Refer to the FL Studio manual.
Included since API version 1.
setTrackStereoSep(index, pan, pickupMode=midi.PIM_None)
Sets the stereo separation of the track at index
. Stereo separation
lies within the range 100% centered (-1.0
) - 100% separated (1.0
). Note
that the default value is 0.0
. Use the pickup mode flag to set pickup
options.
Args
-
index
(int
): track index. -
sep
(float
): stereo separation of track. -
pickupMode
(int
, optional): define the pickup behavior. Refer to the FL Studio manual.
Included since API version 12.
setTrackVolume(index, volume, pickupMode=midi.PIM_None)
Sets the volume of the track at index
. Volume lies within the range
0.0
- 1.0
. Note that the default value is 0.8
. Use the pickup mode
flag to set pickup options.
Args
-
index
(int
): track index. -
volume
(float
): volume of track. -
pickupMode
(int
, optional): define the pickup behavior. Refer to the FL Studio manual.
Included since API version 1.
soloTrack(index, value=-1, mode=-1)
Toggles whether the track at index is solo.
Args
-
index
(int
): track index. -
value
(int
, optional): the new value for the solo state (1
for solo,0
for unsolo). Defaults to-1
(toggle). -
mode
(int
, optional): solo mode to use. One of:* `1`: solo mixer track including source tracks. * `2`: solo mixer track including send tracks. * `3`: solo mixer track including source and sends. * `4`: solo only this mixer track.
Included since API version 1.
swapTrackChannels(index, value=False)
Toggle whether left and right channels are swapped for the mixer track at
index
.
KNOWN ISSUES
- If a
value
isn't supplied, the value will be set toFalse
rather than toggled.
Args
index
(int
): Index of track to swap channels for.value
(bool
): Whether channels should be swapped or not.
Included since API Version 19.
trackCount()
Returns the number of tracks available on the mixer.
The value returned by this function includes master and "current track" tracks.
The range of accessible tracks is from 0
to trackCount() - 1
.
Returns
int
: number of tracks.
Included since API version 1.
trackNumber()
Returns the index of the first currently selected mixer track.
Returns
int
: selected mixer track.
Included since API version 1.