npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@holzchopf/flstudio-control-surface-state

v4.0.1

Published

Reads and writes FL Studio Control Surface plugin states.

Readme

This file was auto-generated with zdoccer.js 2.0.3

Index


original Markdown from src/_preamble.md

@holzchopf/flstudio-control-surface-state

Allows to read and write FL Studio Control Surface states. The main goal of this package is to modify Control Surface states.

The state format

The state consists of a header, followed by body consisting of a variable number of events. I chose the name event because the official documentation for the .flp file format - which used a similar "event" based approach - called those data packages events.

State header

The header typically 4 bytes long. Probably indicating the format version, it is usually the number 1 stored as uint32le

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | uint32le | version | 0x01 00 00 00

State body

The body is of variable length and consists of events. Each event has this structure:

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | uint32le | type | 4 | uint64le | size (byte) of event data | 12 | - | event data

Events

All events can be grouped into Control Surface options (types 20xx) or controls (types 21xx). Listed here are event types typically found:

2000 - Surface Settings

This event is typically 64 bytes long and contains Control Surface settings:

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | uint32le | skip (skip # numbers for the next control's name) | 4 | uint32le | flags Bit 0: editBit 1: hide buttonsBit 2: hide labels | 8 | uint32le | grid size

The rest of the data is typically set to 0x00.

2002 - Surface Dimensions

This event is typically 8 bytes long.

| Offset | Format | Description | ---: | --- | --- | 0 | uint32le | width | 4 | uint32le | height

2003 - unknown

This event is typically 4 bytes long.

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | uint32le | unknown | 0x02 00 00 00

2100 - Start Control

This event is typically 32 bytes long.

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | uint32le | control type

The rest of the data is typically set to 0x00.

2101 - End Control

This event is typically 0 bytes long.

2102 - Enable Control

This event is typically 12 bytes long and describes how to expose this control. A Control can have multiple of these events (i.e. X/Y Controllers have two).

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | float32le | current value | 4 | float32le | default value | 8 | uint32le | list index

2103 - Control Name

The value of this event is a utf-16le string.

2104 - Control Dimensions

This event is typically 16 bytes long and describes the position and size of the control.

| Offset | Format | Description | Typical Value | ---: | --- | --- | --- | 0 | float32le | x center coordinate | 4 | float32le | y center coordinate | 8 | float32le | width | 12 | float32le | height

2105 - ILControl

The value of this event is a utf-16le string. It typically contains all the definitons a .ilcontrol file contains.

2106 - ILControl, Colors

The value of this event is a utf-16le string. It typically contains the color definitions from the ILControl event.

2107 - ILControl, Properties

The value of this event is a utf-16le string. It typically contains the property definitions from the ILControl event.


transformed Javadoc from src/fl-control-surface.ts

class FLControlSurfaceState

Class representing an FL Studio Control Surface plugin state.

version: number = 1

State version number.

options = new FLCSSOptions()

Surface options.

controls: FLCSSControl[] = []

Controls on this surface.

getBinary(): ArrayBuffer

Creates the binary data for this surface and returns it.

setBinary(buffer: ArrayBuffer)

Sets this surface's values from binary data.

  • param buffer — Binary data.

transformed Javadoc from src/flcss-control-type.ts

type FLCSSControlTypeName = keyof typeof FLCSSControlTypeRaw

Known control type names.

type FLCSSControlTypeId = typeof FLCSSControlTypeRaw[FLCSSControlTypeName]

Known control type IDs.

const FLCSSControlType =

Types of controls in a FLCSSStartControlEvent .

name: (id: number): FLCSSControlTypeName | 'unknown' =>

Returns the name of a given control type ID, or 'unknown'.

  • param id — Control type ID.

byName: (name: string): FLCSSControlTypeId | undefined =>

Returns the ID for a given control type name, or undefined

  • param name — Control type name.

transformed Javadoc from src/flcss-event-group.ts

class FLCSSEventGroup

Class representing a group of FLCSSEvent s.

getEventOfType<T extends FLCSSEvent>(type: FLCSSEventTypeId): T|undefined

Returns the first event in this group of given type id.

getEventOfTypeName<T extends FLCSSEvent>(type: FLCSSEventTypeName): T|undefined

Returns the first event in this group of given type name.

getEventsOfType<T extends FLCSSEvent>(type: FLCSSEventTypeId): T[]|undefined

Returns all events in this group of given type id.

getEventsOfTypeName<T extends FLCSSEvent>(type: FLCSSEventTypeName): T[]|undefined

Returns all events in this group of given type name.

getEvents(): FLCSSEvent[]

Returns the FLCSSEvent s making up this group.

setEvents(events: FLCSSEvent[])

Sets the FLCSSEvent s making up this group.


transformed Javadoc from src/flcss-event-type.ts

type FLCSSEventTypeName = keyof typeof FLCSSEventTypeRaw

Known event names.

type FLCSSEventTypeId = typeof FLCSSEventTypeRaw[FLCSSEventTypeName]

Known event IDs.

const FLCSSEventType =

Types of the events in an FLCSSEventGroup .

name: (id: number): FLCSSEventTypeName | 'unknown' =>

Returns the name of a given event ID, or 'unknown'.

  • param id — Event ID.

byName: (name: string): FLCSSEventTypeId | undefined =>

Returns the ID for a given event name, or undefined

  • param name — Event name.

transformed Javadoc from src/flcss-event.ts

abstract class FLCSSEvent

Base class for state events.

type: number

Numeric FLCSSEventType .

get typeName()

Name of FLCSSEventType . Readonly.

abstract getBinary(): ArrayBuffer

Returns this event's binary data.

abstract setBinary(buffer: ArrayBuffer): void

Sets this event's binary data.

  • param buffer — Binary data.

class FLCSSBinaryEvent extends FLCSSEvent

Event with unspecified binary data.

class FLCSSStringEvent extends FLCSSEvent

Event with string value data.

class FLCSSStartControlEvent extends FLCSSEvent

Event starting a new FLCSSControl

class FLCSSEnableControlEvent extends FLCSSEvent

Describes how a control is exposed. Enabled controls will have at least one of these events.

function createEvent(type: number, buffer?: ArrayBuffer)

Factory function to create a new specific FLCSSEvent.

  • param type — FLCSSEventType.
  • param value — Binary data for this event.

transformed Javadoc from src/flcss-options.ts

class FLCSSOptions extends FLCSSEventGroup

Class representing control surface options. Extends FLCSSEventGroup .

settings?: FLCSSSettingsEvent

Settings event.

dimensions?: FLCSSDimensionsEvent

Settings event.


transformed Javadoc from src/flcss-surface-control.ts

class FLCSSControl extends FLCSSEventGroup

Class representing a control on the surface. Extends FLCSSEventGroup .

start?: FLCSSStartControlEvent

Start event.

end?: FLCSSEvent

End event.

enable?: FLCSSEnableControlEvent[]

Enable events.

name?: FLCSSStringEvent

Name event.

dimensions?: FLCSSControlDimensionsEvent

Dimension event.

ILControl?: FLCSSControlDefinitionsEvent

ILControl event.

colors?: FLCSSControlDefinitionsEvent

Color event.

properties?: FLCSSControlDefinitionsEvent

Properties event.