Score
The flpianoroll.score
object is used to represent the state of the piano
roll.
score
module-attribute
The singular instance of the Score
class, used to access and manipulate data
in FL Studio's piano roll.
Score
Access via the module attribute flpianoroll.score
.
Represents the current selection of the FL Studio score, or, if there is no selection, the full contents of the current instrument on the piano roll.
tsnum
property
The project's overall time signature numerator, as per the project settings. Note that this does not reflect time signature markers.
Read-only.
tsden
property
The project's overall time signature denominator, as per the project settings. Note that this does not reflect time signature markers.
Read-only.
snap_root_note
property
Root note of the piano roll's snap to scale setting,
where C is note 0
.
Note that this does not reflect key/scale markers.
Read-only.
snap_scale_helper
property
String in the form of 0,1,0,1,0,0,1,0,1,0,1,0
with 0 indicating notes
in the scale and 1 indicating notes not in scale of the piano
roll's snap to scale setting.
This helper is always C-aligned.
Note that this does not reflect key/scale markers.
Read-only.
clear
Clear the selected notes and markers on the piano roll, or if there is no selection, clear everything.
Markers are considered to be selected if all notes within them are selected.
Args
all
(bool
, optional): whether to clear all content from the score, regardless of selection status. Defaults toFalse
.
clearNotes
Clear the selected notes on the piano roll, or if there is no selection, clear all notes.
Args
all
(bool
, optional): whether to clear all notes from the score, regardless of selection status. Defaults toFalse
.
clearMarkers
Clear the selected markers on the piano roll, or if there is no selection, clear all markers.
Markers are considered to be selected if all notes within them are selected.
Args
all
(bool
, optional): whether to clear all markers from the score, regardless of selection status. Defaults toFalse
.
getNote
Return the note at position index
from within the score.
Args
index
(int
): index of note
Returns
Note
: the note
deleteNote
Remove the note at position index
from within the score.
Args
index
(int
): index of the note to remove
addMarker
Add a marker to the score.
Args
marker
(Marker
): the marker to add
getMarker
Return the marker at position index
from within the score.
Args
index
(int
): index of marker
Returns
Marker
: the marker
deleteMarker
Remove the marker at position index
from within the score.
Args
index
(int
): index of the marker to remove
getTimelineSelection
Returns the selected timeline range.
Returns
tuple[int, int]
: selection start, selection end (start is -1 if no selection was made)
getDefaultNoteProperties
Returns a note with the currently active style.
Returns
Note
: note with the draw tool's current properties
getNextFreeGroupIndex
Returns the next free note group index.
If your script adds multiple groups, make sure to add the notes of one
group using addNote
before calling this function again to get the
updated next free group index.
Returns
int
: Next free note group index