Nature of this document. Clean-room reverse engineering, behavioural only, to guide the design of a new and independent DAW (C++/JUCE). No Image-Line code, and no decompiled pseudocode, has been copied. Everything below is a description, in our own words, of behaviour, structures (conceptually) and algorithms. Addresses and symbol names serve only as traceability of the evidence.
~/projetos/daw-analise/FLEngine_x64.dll (Delphi, PE x86-64, ~22 MB)6d9c5ab09c1d5594012ac2c31cf9ed08e73f42164ed0964cccae10a95d9b8e02| Mark | Meaning |
|---|---|
| [DECOMP] | Confirmed by reading the decompilation of the cited function(s) |
| [STR] | Inferred from strings / RTTI names of Delphi classes and units |
| [HYP] | Hypothesis (plausible, not yet verified) |
Convention: FUN_xxxxxxxx = function address in Ghidra; G[0x15e....] = global pointer of the DLL
(Delphi unit variable).
The engine is a single global "god object" with state in unit variables, not an encapsulated object graph. The hot path is:
Driver (ASIO thread / own mixing thread / DirectSound)
└─ FUN_00d0ece0 render(N samples) ── splits the buffer into sub-blocks at the sequencer's tick boundaries
├─ FUN_00d0e840 advances 1 tick (song position, markers, countdown)
└─ FUN_00d0eb10 → FUN_00d0d4c0 processes 1 sub-block:
├─ transport/loop/markers, start/stop fade
├─ generators (Channel Rack channels) → summed into the mixer tracks' buffers
│ ("threaded" generators run in a parallel task group)
└─ FUN_00cf42f0 mixer: runs the "layers" of the mixer threading map
A single global CRITICAL_SECTION (G[0x15e3d40]) wraps the entire render in all drivers and
also the rebuild of the mixer threading map. [DECOMP]
FUN_00d0ece0 [DECOMP]Behaviour:
G[0x15e0b78]) and the sample position of the next tick
(G[0x15e1a00]).G[0x15e3450]) to which
"samples per tick" (G[0x15e2600], also double) is added at each tick, and then rounded. That is, the
tick time is fractional and does not accumulate rounding error. There is an alternative mode in which
the accumulator is multiplied by a float factor and the result is shifted <<3 (positions in 1/8 of a
sample?) [HYP].G[0x15e3aa0]) and calls the
tick processor (FUN_00d0e840), which increments the song position in ticks (G[0x15e3550]),
handles pre-roll/countdown (mode G[0x15e09f8]==2) and markers.min(next tick, target). The sub-block size goes to
G[0x15e4dc8]; if it is larger than the allocated maximum, the work buffers are reallocated on the spot
(FUN_00d0ead0 → FUN_00d0cee0).len*8 bytes (interleaved stereo float32)
(FUN_00d0eb10). At the end, the pointer returns to the start.Central conclusion: FL does not process the driver buffer all at once. It slices it at the
sequencer's tick boundaries (PPQ), and all note and automation events fall on sub-block boundaries.
This is FL's classic model ("tick-accurate"), and explains why FL delivers variable-size buffers
to plugins (and why the "fixed size buffers" option exists, which increases latency; see strings
0x14890ae).
In offline render there is a tail detector: after the end of the song, it tests whether the master has
dropped below a threshold (dB×−96 scaled) to end the render (FUN_00d0eb10). [DECOMP]
Overflow protection: when the sample counter exceeds 0x7FA81BFE (~2.14 billion), all
position counters (int and double) are shifted together by that same amount (FUN_012aef00).
[DECOMP]
FUN_00d0d4c0 [DECOMP]Observed order:
(1−cos)/2 raised to 9, mapped to 0.01…1) avoids clicks when starting or stopping. It is protected by
its own CRITICAL_SECTION.+0x258, limited
to 0…500). Channels with several outputs have a list of outputs, each with a track offset. The sum into
each track is protected by a per-track CRITICAL_SECTION (track +0x4c), because generators
running on different threads may write to the same track. After the sum the track is marked as
"has signal" (+0x148 = 2).DAT_016b8dd8, vtable +0x10/+0x18).FUN_00cf42f0 (see §2).DAT_015f4648, probably
exported by the host executable) with default count = number of logical threads of the machine
(FUN_00666b40, FUN_012c6f30). Delphi unit: QuickThreads, class TSTBTaskGroup [STR].G[0x15e0348]) with one context object per worker slot
(scratch buffers), created at initialisation (FUN_012c6f30).CreateEventW, auto-reset) for the join (FUN_00666a60, FUN_00666960).
submit+wait = vtable +0x10 / +0x18 (FUN_00666a30).LOCK dec) of a global counter of remaining items (G[0x15e2f38]). The value obtained is the index of
the item to process, and the loop ends when the counter becomes negative (FUN_011fec40, FUN_011febf0).
There is no per-thread queue: it is a shared counter ("self-scheduling").TMixerThread (ASIO with its own thread), TMixerThread_DS
(DirectSound), TRenderThread/TRenderWorker/TMixDownWorker/TRealtimeMasterWorker (render
to file), TMIDIThread/SyncThread, TWAVStreamingThread, TSampleLoaderThread,
TBridgeReaderThread/TBridgeProcessingThread (bridge), browser/scan threads.AvSetMmThreadCharacteristicsW / AvSetMmThreadPriority and
contains the string "Pro Audio" [STR]; the exact use was not traced.Only ASIO and DirectSound live in FLEngine. There is no WASAPI string in the DLL. "FL Studio ASIO" is a separate ASIO driver (the engine only detects it and warns: "Your audio device is set to FL Studio ASIO. This can cause inaccurate MIDI sync timing."). [STR]
FUN_00c56ae0 (bufferSwitchTimeInfo) [DECOMP]Records the block timestamp (system time from ASIOTime or timeGetTime, plus QPC). Then
follows one of three modes:
| Mode | Condition | Behaviour |
|---|---|---|
| A. Inline | no mixing thread | Inside the ASIO callback: takes the global lock, advances the counter by +bufferSize, points each track's I/O pointers directly at the active half of the ASIO double buffer, renders, calls ASIOOutputReady and clears the master. |
B. Own thread (TMixerThread, FUN_00c55740) |
mixing thread active | The callback does SignalObjectAndWait(evStart, evDone, timeout). The mixing thread wakes up, renders and signals. With timeout (DAT_016b8814, configurable): if it expires, the callback resets the state and counts an underrun (FUN_00c57950, FUN_01253980). |
| C. Intermediate buffer | flag DAT_016b87e8 |
Copies or converts between FL's intermediate buffers and the ASIO buffers (per-format conversion function), signals the mixing thread to render the next block asynchronously and adds 1 buffer to the reported output latency. |
There is also a reentrancy/busy guard (G[0x15e0430] > 0 → skips the render).
Opening ASIO — FUN_00c57a00 [DECOMP]:
ASIOBufferInfo (0x18 bytes: isInput, channel, 2 pointers) only with the channels used
by the mixer tracks: outputs come in stereo pairs per track (+0x370 = output pair index,
+0x378 = input).+0x74).Buffer length: N frames, I/O latencies and Time out: X ms.TMixerThread_DS (FUN_012aef00) [DECOMP]Circular buffer in two halves. Waits for 2 notification events (WaitForMultipleObjects) or,
alternatively, polls the play cursor. Renders the free half and converts float → int16
(or copies float32 when the format is 32-bit). Detects underrun when the play cursor falls inside the
freshly written region.
FUN_0125a760 [DECOMP + HYP]A "render N samples now" function (limited to the buffer size), used when the engine is driven from outside. Hypothesis: FL as plugin/ReWire or external host.
frames*2 floats.MidiBuffer and offsets, but slicing simplifies the
automation of parameters of plugins that only accept per-block values. Recommendation: sample-accurate by
default, with optional slicing per plugin.AudioIODevice callback is already the real-time
thread, so the recommended approach is to render inline and use workers for parallelism.CRITICAL_SECTION is simple but can cause contention.
Prefer private buffers per generator, summed by the track owner.G[0x15e06a0]), with 0x1478 bytes (5,240 B) per track.0x1f5) as special (it is left out
of the post-mix cleanup and of the normal layer). Interpretation: 0 = Master, 1…500 = inserts, 501 = special
track ("Current"/preview) [HYP for the exact role]. FL 2026 therefore supports up to
500 inserts.+0x134c). A flag at +0x380 indicates
"slots enabled" (FUN_00cf3660).+0x34 audio buffer pointer; +0x4c track lock; +0x74 output routine
to hardware; +0xd0/+0xe4/+0xec ASIO I/O pointers; +0xfc level in the graph (see
below); +0x148 signal flag; +0x1c0 track "processor" object (virtual method
Process(len)); +0x370/+0x378 physical output/input.FUN_00cf3790 [DECOMP]Scheduling algorithm (our description):
+0xfc), i.e. a topological
order of the routing graph.min(number of units, number of workers) tasks.Execution (FUN_00cf42f0 → FUN_00cf4250 → FUN_011fec40 → FUN_00cf4430):
Process(len) of the track object, with the worker context injected.0xEB (235) and track parameters in 0xEC (236);
see §5. The topological level +0xfc is recomputed from that graph.TFXTrackSideIOList and TMixerImplementation [STR]."%sms (manual) + %sms (plugin)"."Latency: input: %dsmp, output: %dsmp, output + plugins: %dsmp".FLhd, offset 12) and is kept in a global (G[0x15e0db0]). A special
legacy value (16) is replaced by the current default PPQ. There is a "Timebase (PPQ)" UI and the data-loss
warning when reducing the PPQ [STR].0x9C (156) sets the full tempo. The legacy event
0x42 (66) sets the integer part (×1000, preserving the fraction). There is also a fine-tuning
event 0x5D (93) [DECOMP for 0x42/0x9C].G[0x15e3550]), incremented 1 by 1 by the tick processor.TChannel objects in a list (G[0x15e2218]) with the generator plugin, their own output buffer
and destination track [DECOMP]. TChannelSample/TChannelSamplePool handle the samples [STR].G[0x15e2aa0]). Maximum
pattern index on load: 999 (event 0x41 limited to 999) [DECOMP].G[0x15e0ef0]==1 → Song mode (playlist), otherwise Pattern mode [DECOMP].0xE0/224): up to FL 20.99 it is 24 bytes per note; in newer
versions the size is the native size of the current record (FUN_00f558e0) [DECOMP]. The read
confirms these fields:
+0x10 = fine pitch (versions < 3.1.6 get 120 = centre) [DECOMP];+0x13: the low nibble is converted in versions < 5.3 (probably MIDI channel/colour) [DECOMP].0x63 (99) selects or creates the current arrangement
("FLP : Wrong arrangement index !"). [DECOMP]0xE9 (233), as an array of records: 32 bytes up to FL 20.99, and
in newer versions the native size, with variants of 60 (0x3C) and 80 (0x50) bytes depending on
file flags. [DECOMP]TPlaylistFadesTest), clip merge and chop.
Time markers in 0x34-byte records in the arrangement (song+0x21C48). [DECOMP]TAutomationDelay, per-clip "Mapping formula", control recording events
(0xD8 CtrlRecChan, 0xDF PatCtrlRecChan).tempo_flp / 1000.0.TVSTPluginEditor, TVSTPresetFile), VST3 (TPluginFormatVST3,
TVST3Plugin, TVST3ComponentHandler 1/2/3, TVST3ParameterChanges, TVST3EventList, module
Vst3ModuleInfo = reading of moduleinfo.json, own extensions il.VST3Extensions,
VST3_IPSLHostCommands/IPSLContextInfo), CLAP (TPluginFormatCLAP, TCLAPPlugin,
clap_entry, extensions clap.thread-pool, clap.thread-check, clap.latency) and the native
FL format (TPluginFormatFL).clap.thread-pool extension implies that the host exposes its thread pool to CLAP plugins.32bit\ilbridge.exe and 64bit\ilbridge.exe. The per-plugin option "Load plugin in separate
process (bridged)" and "Make bridged" show that the bridge serves both for 32↔64 bits and for
sandboxing at the same bitness.IPC.Bridge: TBridge, TBridgeShare (base), TBridgeMessageShare, TBridgePingShare
(heartbeat), TBridgeDataShare, TBridgeReaderThread, TBridgeProcessingThread,
TBridgeProcessingJob, TWaitingThreadInfo (dictionary per thread-id for synchronous calls),
TBridgeWrapperProcessThread/Share (audio processing), TSimpleBridgeEventBuffer."%s_%d_%s" and "%s_%d_data"
(prefix, numeric id, suffix). Creation does OpenFileMappingW and, if it does not exist,
CreateFileMappingW on the pagefile with the requested size, followed by MapViewOfFile (FUN_00c83820,
FUN_00c915b0).PostMessage(PM_ProcessMessages), "Disconnect calls ExecuteOnGUIThread".Software\Image-Line\FL Plugin Scanner),
TScanThread, TCopyPluginDBThread, "fast plugin scan", plugin database
("Scanning plugin database (generators/effects)").TPlugMonitor/TPlugMeasureEntry: per-plugin CPU measurement.clap-juce-extensions or our own CLAP
host, and plan for exposing thread-pool.lynx-bridge process per plugin or per group.This section is the most precise: the event reader was fully decompiled.
FUN_00f51fd0, FUN_00f54900, FUN_00f54d70)Offset Size Contents
0 4 "FLhd"
4 4 header chunk size (normally 6). The reader skips to 8+size
8 2 format (u16 LE)
10 2 number of channels (u16 LE)
12 2 PPQ (u16 LE); the legacy value 16 is replaced by the default PPQ
-- 4 "FLdt"
+4 4 data chunk size
+8 ... sequence of events until end of file
The file must be at least 0x16 (22) bytes. Format values seen in the code: 0x00 =
project (song), 0x10 = score, 0x18 = automation, 0x20 = channel preset, 0x30–0x32 = plugin
presets (0x31/0x32 chosen by bit 0x10 of the flags of event 0xD4), 0x40 = mixer track
preset [DECOMP for the values; names come from the messages "project/preset/score/automation"]. A
format-0x20 target accepts a 0x30 file. An incompatible format produces "Project format is not compatible with
target, aborting".
FUN_00a9e7a0 and readers FUN_00a9e430/4d0/570/610)0xAC (172), reads 4 more bytes (u32 LE) which are the extended ID.| ID (1 byte) | Extended ID (high bits) | Payload |
|---|---|---|
0x00–0x3F |
0x0xxxxxxx |
1 byte (u8) |
0x40–0x7F |
0x4xxxxxxx |
2 bytes (u16 LE) |
0x80–0xBF |
0x8xxxxxxx |
4 bytes (u32 LE; value treated as signed int32) |
0xC0–0xFF |
0xCxxxxxxx |
variable size: varint + bytes |
0xD5 (plugin state data), which is read later on demand
(FUN_00f45ad0).+0x11, FUN_00a9ece0):
decryption or checksum [HYP].version > 11.5.4, strings are UTF-16LE; otherwise,
ANSI (reader flag +0x10) (FUN_00a9e8e0).Extended IDs seen in the dispatcher: 0xC0000100, 0xC0000102 (variable text, e.g. a list of strings
parsed line by line) and ID 0x100 (outside the 1-byte range, therefore only reachable via 0xAC).
Event 0xC7 (199) is the version string (e.g. "25.1.2.4567"). It is converted to an integer
major*1,000,000 + minor*1,000 + patch and used in dozens of compatibility gates:
8.1.0 (old records), 11.5.4 (UTF-16), 12.9.0, 20.99.1 (size of note and playlist records),
24.2.99 etc. A file newer than the program produces a warning.
The dispatcher FUN_00f46490 (3,753 decompiled lines) handles 181 distinct IDs. The names below
follow the community's public nomenclature (FLP SDK/PyFLP). The "Evidence" column indicates what we confirmed
by decompilation.
| ID | Class | Name (community) | Evidence in this binary |
|---|---|---|---|
| 0x00 | u8 | ChanEnabled | handled |
| 0x09 | u8 | LoopActive | calls loop setter |
| 0x0F | u8 | (pattern/channel flag) | handled |
| 0x15 (21) | u8 | ChanType (0…5) | [DECOMP] range 0–5 validated ("ABORT FLP_ChanType … out of range") |
| 0x16 (22) | u8 | TargetFXTrack | [DECOMP] "FLP_TargetFXTrack target track out of range" |
| 0x1B (27) | u8 | FX track flags | [DECOMP] bits 0x1/0x2/0x4/0x8/0x10 → track flags; bit 0x10 disables the slots |
| 0x32 (50) | u8 | (channel property) | handled |
| 0x40 (64) | u16 | NewChan (index of current channel) | [DECOMP] creates or selects the channel |
| 0x41 (65) | u16 | NewPat (index of current pattern) | [DECOMP] limited to 999 |
| 0x42 (66) | u16 | Tempo (integer part, legacy) | [DECOMP] tempo = v×1000 + old fraction |
| 0x44 (68) | u16 | (16-bit mask per pattern) | [DECOMP] 16 flags |
| 0x5D (93) | u16 | TempoFine | handled |
| 0x63 (99) | u16 | Current arrangement | [DECOMP] |
| 0x8A (138) | u32 | (two 16-bit fields) | [DECOMP] |
| 0x93 (147) | u32 | FXOutChanNum | [DECOMP] index correction in versions < 3.6.3 |
| 0x9C (156) | u32 | FineTempo (BPM×1000) | [DECOMP] |
| 0x9E (158) | u32 | (pattern field, +0x18) | [DECOMP] |
| 0xC4 (196) | text | SampleFileName | [DECOMP] / → \ |
| 0xC7 (199) | text | Version | [DECOMP] |
| 0xD4 (212) | data | NewPlugin (0x34-byte header; flags at +0x10, bit 0x10 = generator/effect) | [DECOMP] |
| 0xD5 (213) | data | PluginParams (opaque plugin state) | [DECOMP] skipped and read on demand |
| 0xE0 (224) | data | PatNoteRecChan = pattern notes (array of note records) | [DECOMP] |
| 0xE9 (233) | data | Playlist items (array) | [DECOMP] |
| 0xEB (235) | data | Mixer routing | [STR/HYP] |
| 0xEC (236) | data | Mixer track parameters (includes a field obfuscated by XOR with a constant) | [DECOMP] |
| 0xED (237) | data | (16-byte record) | handled |
| 0xF0 (240) | text | (global string list) | [DECOMP] |
| 0xF6 (246) | text | (channel name/property) | handled |
| 0xE2/0xE3 | data | (range handled together, id-0xE2) |
handled |
Full list of the 1-byte IDs seen in the dispatcher (hex):
00–06, 09–24, 26–34, 40–50, 53–59, 5B–5F, 61–65, 67, 68, 80–84, 87, 8A–96, 98–9E, A0–A2, A4–AB, C0–CF,
D1, D2, D4, D5, D7–DD, DF, E0, E1, E4–E7, E9–F3, F5–FF, plus the extended 0x100 and
0xC0000100/0xC0000102.
FUN_00f558e0)Array events (notes, playlist, controls) are read as a blob and reinterpreted with a record size that depends on the version:
| Type | < 8.1.0 | 8.1.0 … < 20.99.1 | ≥ 20.99.1 |
|---|---|---|---|
| 0 (control/automation) | legacy converter | 12 bytes | current native size |
| 1 (notes) | legacy converter | 24 bytes | current native size |
| 2 (playlist) | legacy converter | 32 bytes | 60 or 80 bytes, or the native size, depending on flags |
That is: to import FLP, the record size must be derived from the event size ÷ number of items, or from the version, and not hard-coded.
0xAC escape + 32-bit ID, which probably
breaks older community parsers.version > 11.5.4, and the PPQ from the header.0xD5 (plugin state) as an opaque blob. It can only be reused when the same
VST/VST3/CLAP plugin exists on our side: the wrapper payload contains the plugin chunk, but the internal
format of the wrapper still needs study.u32 / 1000.0 BPM (event 0x9C).+0xfc and of the accumulated latency still needs to be decompiled.object +0x1c0, virtual Process): pre/post-fader order of the 10
slots, sends, panning law, mute/solo, smart disable. The vtable needs to be resolved.<<3): is it sub-sample timing?DAT_015f4648): does it come from the FL64.exe executable? What is the
affinity/priority and MMCSS policy of the workers?FL64.exe? in the "FL Studio ASIO" driver?). It is not in this DLL.+0x11, FUN_00a9ece0): checksum, encryption or
integrity hash?| Address | Inferred role | Confidence |
|---|---|---|
FUN_00c56ae0 |
ASIO bufferSwitchTimeInfo (3 modes) | DECOMP |
FUN_00c55740 |
Execute of TMixerThread (ASIO) |
DECOMP |
FUN_00c57a00 |
ASIO buffer creation, track I/O mapping, latency log | DECOMP |
FUN_012aef00 |
DirectSound mixing thread | DECOMP |
FUN_0125a760 |
Render by external pull | DECOMP |
FUN_00d0ece0 |
Tick-sliced render loop | DECOMP |
FUN_00d0e840 |
Advance of 1 tick (song position / countdown) | DECOMP |
FUN_00d0eb10 |
Sub-block wrapper + tail detector + master pointer advance | DECOMP |
FUN_00d0d4c0 |
Processes sub-block: transport, fade, generators, mixer | DECOMP |
FUN_00cf3790 |
Rebuilds the mixer threading map (layers/units) | DECOMP |
FUN_00cf42f0 |
Runs the mixer (serial or by layers) | DECOMP |
FUN_00cf4250 |
Dispatches the next layer | DECOMP |
FUN_011fec40 / FUN_011febf0 |
Worker tasks (mixer / generators), atomic counter | DECOMP |
FUN_012c6f30 |
Init: thread pool + per-worker contexts | DECOMP |
FUN_00666a60 / FUN_00666b40 |
Task group (QuickThreads) | DECOMP |
FUN_00f51fd0 |
Opens the FLP and validates the FLhd/FLdt header | DECOMP |
FUN_00f46490 |
FLP event dispatcher (181 IDs) | DECOMP |
FUN_00a9e7a0 |
Event reader (ID + 0xAC escape + size class) | DECOMP |
FUN_00a9e610 |
Variable payload reader (varint) | DECOMP |
FUN_00f558e0 |
Versioned record array reader | DECOMP |
FUN_00c83820 |
Named shared memory (bridge) | DECOMP |