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
isFalse
).
- 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.Note[source]#
- fine_pitch: int | None#
-
Linear.
Type
Value
Representation
Min
0
-1200 cents
Max
240
+1200 cents
Default
120
No fine tuning
- 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}).