Parse FL Studio 2024/2025 playlist items (80-byte records)#205
Open
CryptoJones wants to merge 1 commit into
Open
Parse FL Studio 2024/2025 playlist items (80-byte records)#205CryptoJones wants to merge 1 commit into
CryptoJones wants to merge 1 commit into
Conversation
FL 2024/2025 (21.2+ / 25.x) grew each playlist item to an 80-byte record: a 20-byte tail (_u4) after FL 21's 28-byte tail (_u3). PlaylistEvent only knew the 32- and 60-byte layouts, so these events failed the size check and their clips were dropped (demberto#177, demberto#199, demberto#200). Add the _u4 block gated on a `fl2025` param, extend SIZES to include 80, and detect it by the fixed size that divides the payload — preferring the 60-byte reading on a 60/80 common multiple so files that parsed before are unaffected. The record layout was verified byte-for-byte against FL Studio 2025 saves, and a synthetic-event test asserts the 80-byte records parse and round-trip. Known limitation (documented in-code): clips edited in FL grow past 80 bytes, so a heavily-edited project's Playlist event can be variable-length and still not match a single fixed size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
FL Studio 2024/2025 (21.2+ / 25.x) grew each playlist item to an 80-byte record — a 20-byte tail (
_u4) after FL 21's 28-byte tail (_u3).PlaylistEventonly knew the 32- and 60-byte layouts, so FL 2024/2025 playlist events fail the size check and their clips are dropped. Fixes #200 and the same underlying cause behind #199 / #177.The record
Full 80-byte layout, verified byte-for-byte against FL Studio 2025 (25.x) saves:
item_indexselects the item type:< 20480references a channel by iid (an audio clip if that channel'sChannelID.Type == 4, an automation clip if== 5);>= 20480is a pattern clip (pattern_base + pattern#).The change
_u4gated on a newfl2025struct param; extendSIZESto include80.Known limitation (documented in-code)
A freshly placed clip is exactly 80 bytes, but clips edited in FL (fades, slices, resizes) carry extra per-clip data and grow past it — so a heavily-edited project's Playlist event can be variable-length and still not match a single fixed size. Fully general handling would need the project's FL version to disambiguate; this PR fixes the common (fresh / programmatically-written) case without regressing anything.
How this came up
I hit this building FL-Studio-MCP-Server — an MCP server that lets Claude Code drive FL Studio and generate/edit
.flpprojects, with PyFLP powering its offline route. Writing FL 2025 audio-clip arrangements is what surfaced the 80-byte record, so the parse fix belongs upstream. Thanks for PyFLP — it's a joy to build on. 🙏🤖 Generated with Claude Code
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/