Events#

This section is intended for those who want to delve into PyFLP’s low-level API or understand how internally events are ordered. A good understanding of FL Studio’s GUI is assumed.

When to use the low level API?#

If PyFLP fails to parse a particular model or you want to dive deep into the true / raw / real (whatever you want to call it) representation of an FLP.

See also

Binary layout of an event

Structure#

Very early versions of FL Studio were literally a dump of the changes taking place in FL’s GUI. Say for example, you create a channel and then add notes to some pattern; the events for those would be dumped in the same order.

Hopefully its not the same now, but some of those characteristics are still visible.

Caution

DO NOT use the following section as a definitive / complete source of information for adding / removing your own events. While most likely your events will get parsed correctly, there’s always a chance of corrupting your FLPs.

This is roughly the order of the events (as of latest FL Studio):

  1. Project-wide / metadata

  2. Display groups / channel filters

  3. Initialised controls

  4. Pattern notes / controllers

  5. MIDI remote controllers

  6. Internal remote controllers / automations

  7. 1st channel

  8. Pattern metadata

  9. Remaining channels

  10. Arrangements:

    1. Index, name

    2. Playlist items

    3. Time markers

    4. Tracks:

      1. All data except name

      2. Name

  11. Mixer:

    1. Inserts:

      A list of events in the order:

      1. Color, name, icon and flags

      2. Effect slots

      3. Post EQ, input/output, routing

    2. Remaining insert data

  12. Channel rack height

Channel#

There are currently 5 types of channels (specified in ChannelType). Although some of them don’t use certain events, FL Studio dumps the same event tree for any type of channel. For e.g. a Layer channel will have all the events a Sampler channel has, irrespective of whether the events have any meaning in that context. Certain channels have extra events.

#

Event ID

Model / property

1

ChannelID.New

Channel.iid

2

ChannelID.Type

Channel subclasses

3

PluginID.InternalName

Channel.internal_name

4

PluginID.Wrapper

Instrument.plugin

5

PluginID.Name

Channel.name

6

PluginID.Icon

Channel.icon

7

PluginID.Color

Channel.color

8

PluginID.Data

Instrument.plugin

9

ChannelID.IsEnabled

Channel.enabled

10

ChannelID.Delay

_SamplerInstrument.delay [5]

11

ChannelID.DelayModXY

_SamplerInstrument.delay [5]

12

ChannelID.Reverb

Sampler.fx.reverb

13

ChannelID.TimeShift

_SamplerInstrument.time.shift [#1]

14

ChannelID.Swing

_SamplerInstrument.time.swing [5]

15

ChannelID.FreqTilt

Sampler.fx.freq_tilt

16

ChannelID.Pogo

Sampler.fx.pogo

17

ChannelID.Cutoff

Sampler.fx.cutoff

18

ChannelID.Resonance

Sampler.fx.reso

19

ChannelID.Preamp

Sampler.fx.boost

20

ChannelID.FadeOut

Sampler.fx.fade_out

21

ChannelID.FadeIn

Sampler.fx.fade_in

22

ChannelID.StereoDelay

Sampler.fx.stereo_delay

23

ChannelID.RingMod

Sampler.fx.ringmod

24

ChannelID.FXFlags

Quite a few, refer code.

25

ChannelID.RoutedTo

_SamplerInstrument.insert [5]

26

ChannelID.Levels

Sampler.filter + few more

27

ChannelID.LevelAdjusts

_SamplerInstrument.level_adjusts [5]

28

ChannelID.Polyphony

_SamplerInstrument.polyphony [5]

29

ChannelID.Parameters

A lot; spread across many models.

30

ChannelID.CutGroup

_SamplerInstrument.cut_group [5]

31

ChannelID.LayerFlags

Layer.random, Layer.crossfade

32

ChannelID.GroupNum

Channel.group

33*

ChannelID.Automation

Automation

34

ChannelID.IsLocked

Channel.locked

35

ChannelID.Tracking * 2

_SamplerInstrument.tracking [5]

37

ChannelID.EnvelopeLFO * 5

Sampler.envelopes, Sampler.lfos

42

ChannelID.SamplerFlags

Certain Sampler properties.

43

ChannelID.PingPongLoop

Sampler.playback.ping_pong_loop

44*

ChannelID.SamplePath

Sampler.sample_path [6]

Pattern#

Pattern events are serialised at 2 different places inside an FLP. The first section contains the notes and controllers held by a pattern if any.

#

Event ID

Property

1

PatternID.New

Pattern.iid

2

PatternID.Controllers

Pattern.controllers

3

PatternID.Notes

Pattern.notes

The next section contains colour, icon, timemarkers and any new events get added here. Some events aren’t listed because their order is not confirmed yet.

#

Event ID

Property

1

PatternID.New [7]

Pattern.iid

2

PatternID.Name

Pattern.name

3

PatternID.Color

Pattern.color

4

157 [7]

N.A.

5

158 [7]

N.A

6

164 [7]

N.A.

VST plugin parsing#

Implemented in VSTPluginEvent, this is arguably the hardest event to parse cleanly. If you are familiar with PyFLP’s internals, you might be surprised to know that this event has events inside events. Why a struct wasn’t usable is beyond me.