Skip to content

Score

The flpianoroll.score object is used to represent the state of the piano roll.

score module-attribute

score = Score()

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.

PPQ property

PPQ: int

The PPQN (ticks per quarter note) of the score.

Read-only.

tsnum property

tsnum: int

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

tsden: int

The project's overall time signature denominator, as per the project settings. Note that this does not reflect time signature markers.

Read-only.

noteCount property

noteCount: int

The number of notes currently in the score.

markerCount property

markerCount: int

The number of markers currently in the score.

clear

clear(all: bool = False) -> None

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 to False.

clearNotes

clearNotes(all: bool = False) -> None

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 to False.

clearMarkers

clearMarkers(all: bool = False) -> None

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 to False.

addNote

addNote(note: Note) -> None

Add a note to the score.

Args
  • note (Note): the note to add

getNote

getNote(index: int) -> Note

Return the note at position index from within the score.

Args
  • index (int): index of note
Returns
  • Note: the note

deleteNote

deleteNote(index: int) -> None

Remove the note at position index from within the score.

Args
  • index (int): index of the note to remove

addMarker

addMarker(marker: Marker) -> None

Add a marker to the score.

Args
  • marker (Marker): the marker to add

getMarker

getMarker(index: int) -> Marker

Return the marker at position index from within the score.

Args
  • index (int): index of marker
Returns
  • Marker: the marker

deleteMarker

deleteMarker(index: int) -> None

Remove the marker at position index from within the score.

Args
  • index (int): index of the marker to remove