Pattern
Pattern
Bases: _FLObject
Source code in pyflp/pattern/pattern.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
color: Optional[colour.Color] = _ColorProperty()
class-attribute
name: Optional[str] = _StrProperty()
class-attribute
EventID
Bases: enum.IntEnum
Events used by Pattern
.
Source code in pyflp/pattern/pattern.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
Color = DWORD + 22
class-attribute
See Pattern.color
. Default event is not stored.
Controllers = DATA + 15
class-attribute
See Pattern.controllers
.
Name = TEXT + 1
class-attribute
See Pattern.color
. Default event deos not exist.
New = WORD + 1
class-attribute
Marks the beginning of a new pattern, twice.
Notes = DATA + 16
class-attribute
See Pattern.notes
.
index()
writable
property
Pattern index. Begins from 1.
Occurs twice, once near the top with note data and once with rest of
the metadata. The first time a PatternEvent.New
occurs, it is
parsed by parse_index1()
. Empty patterns are not stored at the top
since they don't have any note data. They come later on.
See Parser.__parse_pattern()
for implemntation.
Source code in pyflp/pattern/pattern.py
67 68 69 70 71 72 73 74 75 76 77 |
|
notes()
property
Contains the list of MIDI events (notes) of all channels.
Source code in pyflp/pattern/pattern.py
85 86 87 88 |
|
is_empty()
Whether pattern has note data.
Source code in pyflp/pattern/pattern.py
151 152 153 |
|
PatternNote
Event information
Size: A divisible of 24.
Attention
This event wasn't always a divisible of 24. I found a FL 3.0.0 file where it is a divisible of 20.
Structure:
Parameter | Offset | Type |
---|---|---|
position | 0 | I |
flags | 4 | H |
rack_channel | 6 | H |
duration | 8 | I |
key | 12 | I |
fine_pitch | 16 | b |
unknown | 17 | |
release | 18 | B |
midi_channel | 19 | B |
pan | 20 | b |
velocity | 21 | B |
mod_x | 22 | B |
mod_y | 23 | B |
Bases: _FLObject
Represents a note (MIDI event) in a Pattern
.
Source code in pyflp/pattern/note.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
duration: int = _UIntProperty()
class-attribute
Duration. Proportional to project PPQ. See Misc.ppq
.
fine_pitch: int = _IntProperty(min_=-128, max_=127)
class-attribute
Min: -128 (-100 cents), Max: 127 (+100 cents).
flags: int = _UIntProperty()
class-attribute
Miscellaneous note related flags. TODO
midi_channel: int = _UIntProperty()
class-attribute
For note colors, min: 0, max: 15.
128 for MIDI dragged into the piano roll.
key: int = _UIntProperty()
class-attribute
The note itself. Single notes: 0-131 (for C0-B10). Yet needs 4 bytes, to save stamped chords/scales.
mod_x: int = _UIntProperty()
class-attribute
Mod X. Most probably filter cutoff.
mod_y: int = _UIntProperty()
class-attribute
Mod Y. Most probably filter resonance.
pan: int = _IntProperty(min_=-64, max_=64)
class-attribute
Min: -64, Max: 64.
position: int = _UIntProperty()
class-attribute
Position from pattern start (i.e. 0).
Proportional to project PPQ. See Misc.ppq
.
rack_channel: int = _UIntProperty()
class-attribute
Which Channel
this note is for; since, a single
pattern can hold notes for multiple channels.
release: int = _UIntProperty(max_=128)
class-attribute
Min: 0, Max: 128.
velocity: int = _UIntProperty(max_=128)
class-attribute
Min: 0, Max: 128.
PatternController
Event information
Size: A divisible of 12.
Structure:
Parameter | Offset | Type |
---|---|---|
position | 0 | I |
unknown | 4 | |
unknown | 5 | |
target_channel | 6 | B |
target_flags | 7 | B |
value | 8 | f |
Bases: _FLObject
Source code in pyflp/pattern/controller.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
position = _UIntProperty()
class-attribute
Position relative to pattern start.
target_channel = _UIntProperty()
class-attribute
Target channel
target_flags = _UIntProperty()
class-attribute
TODO
value = _FloatProperty()
class-attribute
Either 0.0 to 1.0 for VST parameters or 0 to 12800 for FL's internal parameters.