Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Repository files navigation

FLParser

A parser for FL Studio project files in .NET.

FLParser is a utility for parsing and structuring project files in FL Studio (FLP files). It is used by the MONAD Demogroup for converting FLP files to a format useable by the demo replayer.

FLParser is based on andrewrk's node-flp, but contains many improvements to clean up code and add compatability for newer versions of FL Studio.

Please note: FLParser is currently in beta. Only the minimal things that we need are currently implemented, and some of them might break - if they do, or you find something new, please submit an issue or pull request.

install

In commandline:

$ cd my/project/directory
$ git clone https://github.com/monadgroup/flparser.git

In Visual Studio:

Solution > Add > Existing Project
Find Monad.FLParser.csproj
Project References > Add Reference > Projects > Monad.FLParser

Nuget package coming soon!

use

Load a project with Project.Load:

Projectproject1=Project.Load("path/to/project.flp");// load from fileStreamsomeStream= ...;Projectproject2=Project.Load(someStream);// load from streamBinaryReadersomeReader= ...;Projectproject3=Project.Load(someReader);// load from binaryreader

reference

classes

class Project

Represents an FLP file. Has the following properties: (all get; set;)

constintMaxInsertCount;// max number of inserts (as of FL 12, equal to 105)constintMaxTrackCount;// max number of tracks (as of FL 12, equal to 199)intMainVolume;// volume of projectintMainPitch;// pitch of projectintPpq;// pulses per quarter-beatdoubleTempo;// tempo of projectstringProjectTitle;// title of projectstringComment;// comment of projectstringAuthor;// author of projectstringGenre;// genre of projectstringVersionString;// xx.xx.xx-formatted string of FL versionintVersion;// int format of versionList<Channel>Channels;// list of channels in projectTrack[]Tracks;// set of tracks in project (length is equal to Project.MaxTrackCount)List<Pattern>Patterns;// list of patterns in projectInsert[]Inserts;// set of inserts in project (length is equal to Project.MaxInsertCount)

class Channel

Represents an individual channel (instrument) in a project. Has the following properties: (all get; set;)

intId;// channel IDstringName;// channel nameuintColor;// 0x00RRGGBB-formatted channel colorIChannelDataData;// channel data, will either be GeneratorData or AutomationData

class GeneratorData : IChannelData

Represents channel data for a generator channel (sampler or plugin). Has the following properties: (all get; set;)

byte[]PluginSettings;// settings saved by the pluginstringGeneratorName;// plugin generator namedoubleVolume;// generator volumedoublePanning;// generator panninguintBaseNote;// generator base noteintInsert;// insert to send audio tointLayerParent;// ???Enums.ArpDirectionArpDir;// direction of arpintArpRange;// range of arpintArpChord;// chord of arp (mapping unknown)intArpRepeat;// number of times to repeat arpdoubleArpTime;// speed of arpdoubleArpGate;// arp note durationboolArpSlide;// slide arp?// for samplers:stringSampleFileName;// path to sampleintSampleAmp;// sample volumeboolSampleReversed;// play sample reversed?boolSampleReverseStereo;// swap stereo channels?boolSampleUseLoopPoints;// ???

class AutomationData : IChannelData

Represents channel data for an automation channel. Has the following properties: (all get; set;)

ChannelChannel;// channel that this automation is controllingintParameter;// parameter to controlAutomationKeyframe[]Keyframes;// automation keyframes

class AutomationKeyframe

Represents an individual keyframe in an automation track. Has the following properties: (all get; set;)

intPosition;// keyframe position in pulsesdoubleValue;// keyframe valuefloatTension;// keyframe tension

class Track

Represents a track in a project playlist. Has the following properties: (all get; set;)

stringName;// track nameuintColor;// 0x00RRGGBB-formatted track colorList<IPlaylistItem>Items;// list of playlist items in track, will either be ChannelPlaylistItem or PatternPlaylistItem

class IPlaylistItem

Represents an item in a track. Has the following properties: (all get; set;)

intPosition;// position of the item in pulsesintLength;// length of the item in pulsesintStartOffset;// position to start in dataintEndOffset;// position to end in data

class ChannelPlaylistItem : IPlaylistItem

Represents a sample or automation item in a track. Has the following additional properties: (all get; set;)

ChannelChannel;// channel to take sample or automation data from

class PatternPlaylistItem : IPlaylistItem

Represents a pattern in a track. Has the following additional properties: (all get; set;)

PatternPattern;// pattern to take note data from

class Pattern

Represents a pattern in a project. Has the following properties: (all get; set;)

intId;// pattern IDstringName;// pattern nameDictionary<Channel,List<Note>>Notes;// the notes that each channel plays in this pattern

class Note

Represents a note in a pattern. Has the following properties: (all get; set;)

intPosition;// note position in pulsesintLength;// note length in pulsesbyteKey;// note key in MIDI formatushortFinePitch;// note pitch adjustmentushortRelease;// note release timebytePan;// note pan, 0 is left and 127 is rightbyteVelocity;// note velocity

class Insert

Represents an insert in a project. Has the following properties: (all get; set;)

constintMaxSlotCount;// max number of effect slots (as of FL 12, equal to 10)intId;// insert IDstringName;// insert nameuintColor;// 0x00RRGGBB-formatted track colorushortIcon;// icon IDEnums.InsertFlagsFlags;// insert flagsintVolume;// insert volumeintPan;// insert panintStereoSep;// stereo separationintLowLevel;// EQ lowpass levelintBandLevel;// EQ bandpass levelintHighLevel;// EQ highpass levelintLowFreq;// EQ lowpass frequencyintBandFreq;// EQ bandpass frequencyintHighFreq;// EQ highpass frequencyintLowWidth;// EQ lowpass widthintBandWidth;// EQ bandpass widthintHighWidth;// EQ highpass widthbool[]Routes;// map of which inserts this insert routes to (length is equal to Project.MaxInsertCount)InsertSlot[]Slots;// set of slots in insert (length is equal to Insert.MaxSlotCount)

class InsertSlot

Represents an effect slot in an insert. Has the following propertie: (all get; set;)

intVolume;// volume of slotintState;// slot state (0 = muted, 1 = enabled, 2 = solo)

enums

All enums are in the Enums static class.

enum Event

List of FLP event types, used for parsing. Consult the source code for a list of values.

enum InsertParam

List of insert parameters, used for parsing. Consult the source code for a list of values.

enum ArpDirection

Potential directions for generator channel's arpeggiator. Values are:

  • Off = 0 - no active arp
  • Up = 1 - arp notes go up
  • Down = 2 - arp notes go down
  • UpDownBounce = 3 - arp notes bounce up and down
  • UpDownSticky = 4 - arp notes stick up and down
  • Random - random arp notes

[Flags] enum InsertFlags

Flags for inserts to specify their states. Values are:

  • ReversePolarity = 1 - reverse polarity of the insert
  • SwapChannels = 1 << 1 - swap left and right channels
  • Unmute = 1 << 3 - insert is audible
  • DisableThreaded = 1 << 4 - threading is disabled on insert
  • DockedMiddle = 1 << 6 - insert is docked to middle
  • DockedRight = 1 << 7 - insert is docked to right
  • Separator = 1 << 10 - insert has separator on left
  • Lock = 1 << 11 - insert is locked
  • Solo = 1 << 12 - insert is solo'd (all other inserts will be muted)

license

Licensed under the GPL3 license. See the LICENSE file for more information.

About

An FL Studio project file parser for .NET

Topics

Resources

Stars

139 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages