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.
In commandline:
$ cd my/project/directory
$ git clone https://github.com/monadgroup/flparser.gitIn Visual Studio:
Solution > Add > Existing Project
Find Monad.FLParser.csproj
Project References > Add Reference > Projects > Monad.FLParser
Nuget package coming soon!
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 binaryreaderRepresents 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)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 AutomationDataRepresents 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;// ???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 keyframesRepresents an individual keyframe in an automation track. Has the following properties: (all get; set;)
intPosition;// keyframe position in pulsesdoubleValue;// keyframe valuefloatTension;// keyframe tensionRepresents 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 PatternPlaylistItemRepresents 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 dataRepresents a sample or automation item in a track. Has the following additional properties: (all get; set;)
ChannelChannel;// channel to take sample or automation data fromRepresents a pattern in a track. Has the following additional properties: (all get; set;)
PatternPattern;// pattern to take note data fromRepresents 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 patternRepresents 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 velocityRepresents 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)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)All enums are in the Enums static class.
List of FLP event types, used for parsing. Consult the source code for a list of values.
List of insert parameters, used for parsing. Consult the source code for a list of values.
Potential directions for generator channel's arpeggiator. Values are:
Off = 0- no active arpUp = 1- arp notes go upDown = 2- arp notes go downUpDownBounce = 3- arp notes bounce up and downUpDownSticky = 4- arp notes stick up and downRandom- random arp notes
Flags for inserts to specify their states. Values are:
ReversePolarity = 1- reverse polarity of the insertSwapChannels = 1 << 1- swap left and right channelsUnmute = 1 << 3- insert is audibleDisableThreaded = 1 << 4- threading is disabled on insertDockedMiddle = 1 << 6- insert is docked to middleDockedRight = 1 << 7- insert is docked to rightSeparator = 1 << 10- insert has separator on leftLock = 1 << 11- insert is lockedSolo = 1 << 12- insert is solo'd (all other inserts will be muted)
Licensed under the GPL3 license. See the LICENSE file for more information.