FL state
Functions to access information about the state of FL Studio.
getRecPPB
Returns the current timebase (PPQN) multiplied by the number of beats in a bar.
Note
- This DOES NOT respect time signature markers in the playlist.
Returns
int
: timebase * numerator.
Included since API version 1.
getRecPPQ
Returns the current timebase (PPQN), which represents the number of ticks per quarter note.
Returns
int
: timebase.
Included since API version 8.
getUseMetronome
Returns whether the metronome is active.
Returns
bool
: metronome enabled.
Included since API version 1.
getPrecount
Returns whether precount before recording is enabled.
Returns
bool
: precount before recording.
Included since API version 1.
getChangedFlag
Returns whether a project has been changed since the last save.
Returns
-
int
: changed flag:-
0
: Unchanged since last save. -
1
: Changed since last save. -
2
: Changed since last save, but unchanged since last auto-save.
-
Included since API version 1.
getVersion
Returns MIDI Scripting API version number. Note that this is the API version, rather than the FL Studio version.
To get the version of FL Studio, use ui.getVersion()
instead.
Returns
int
: version number
Included since API version 1.
processRECEvent
Processes a REC event, usually changing an automatable value.
Try to achieve your task with other API functions first!
This part of FL's scripting API is incomplete, poorly documented, and filled with hidden bugs. REC events expose more controls inside FL Studio, while being much more confusing than other parts of the API.
"REC events" represent every automatable control in FL studio. Each "REC" is identified with a unique integer, "event ID". FL Studio reserves a range of event IDs for each channel, mixer track, plugin, and so on.
REC events have some other properties available:
-
Descriptive name:
device.getLinkedParamName()
-
Current value:
device.getLinkedValue()
-
Current value as an appropriately formatted string:
device.getLinkedValueString()
HELP WANTED
- More information from Image-Line? More details on what
flags
can do?
Args
-
eventId
(int
): Refer to the FL Studio manual. -
value
(int
): value of even within a range. This range depends on the plugin, but you can specify for it to be between0 - 2^30
by using themidi.REC_MIDIController
flag. Note that providing an invalid value can lead to very strange behavior and sometimes crashes. -
flags
(int
): Refer to the FL Studio manual.
Returns
int
: Unknown.
Included since API version 7.
dumpScoreLog
Write recently played MIDI to the selected pattern.
Args
-
time
(int
): The duration of time to write, fromtime
seconds before the last note played, to the last note. -
silent
(int
): Whether the empty score message is suppressed (True
) or not (False
).
Included since API version 15.