Pattern#

class pyflp.pattern.Pattern[source]#

Represents a pattern which can contain notes, controllers and time markers.

color: RGBA | None#

Returns a colour if one is set while saving the project file, else None.

Defaults to #485156 in FL Studio.

property controllers: Iterator[Controller]#

Parameter automations associated with this pattern (if any).

property iid: int#

Internal index of the pattern starting from 1.

Caution

Changing this will not solve any collisions thay may occur due to 2 patterns that might end up having the same index.

length: int | None#

The number of steps multiplied by the pyflp.project.Project.ppq.

Returns None if pattern is in Auto mode (i.e. looped is False).

looped: bool | None#
https://img.shields.io/badge/FL%20Studio-2.5.0+-5f686d?labelColor=ff7629&style=for-the-badge

Whether a pattern is in live loop mode.

name: str | None#

User given name of the pattern; None if not set.

property notes: Iterator[Note]#

MIDI notes contained inside the pattern.

Note

FL Studio uses its own custom format to represent notes internally. However by using the Note properties with a MIDI parsing library for example, you can export them to MIDI.

property timemarkers: Iterator[TimeMarker]#

Yields timemarkers inside this pattern.

class pyflp.pattern.Controller[source]#
channel: int | None#

Corresponds to the containing channel’s Channel.iid.

position: int | None#

Properties obtained from a construct.Struct.

value: float | None#

Properties obtained from a construct.Struct.

class pyflp.pattern.Note[source]#
fine_pitch: int | None#
https://img.shields.io/badge/FL%20Studio-3.3.0+-5f686d?labelColor=ff7629&style=for-the-badge

Linear.

Type

Value

Representation

Min

0

-1200 cents

Max

240

+1200 cents

Default

120

No fine tuning

group: int | None#

A number shared by notes in the same group or 0 if ungrouped.

property key: str#

Note name with octave, for e.g. ‘C5’ or ‘A#3’ ranging from C0 to B10.

Only sharp key names (C#, D#, etc.) are used, flats aren’t.

Raises:
  • ValueError – A value not in between 0-131 is tried to be set.

  • ValueError – Invalid note name (not in the format {note-name}{octave}).

length: int | None#

Returns 0 for notes punched in through step sequencer.

midi_channel: int | None#

Used for a variety of purposes.

For note colors, min: 0, max: 15. +128 for MIDI dragged into the piano roll.

Changed in FL Studio v6.0.1: Used for both, MIDI channels and colors.

mod_x: int | None#

Plugin configurable parameter.

Min

Max

Default

0

255

128

mod_y: int | None#

Plugin configurable parameter.

Min

Max

Default

0

255

128

pan: int | None#

Type

Value

Representation

Min

0

100% left

Max

128

100% right

Default

64

Centered

position: int | None#

Properties obtained from a construct.Struct.

rack_channel: int | None#

Containing channel’s Channel.IID.

release: int | None#

Min

Max

Default

0

128

64

slide: bool | None#

Whether note is a sliding note.

velocity: int | None#

Min

Max

Default

0

128

100

Enums#

class pyflp.pattern.PatternID[source]#
Looped = 26#
New = 65#
Color = 150#
Name = 193#
ChannelIID = 160#
_161 = 161#
_162 = 162#
Length = 164#
Controllers = 223#
Notes = 224#