Class Layer

Represents a layer.


import { Layer } from "@nbsjs/core";

const layer = new Layer({
"name": "Demo"
});

// The "notes" property provides helper functions such as...
layer.notes.add(0, 0, {
"key": 42
});

layer.notes.add(8, 0, {
"key": 24
});

// Deletes the note on tick 8 (which was just added)
layer.notes.delete(8);

// These properties are only used in Note Block Studio and do not affect the functions above
layer.isSolo = true;
layer.isLocked = true;

Properties

isLocked: boolean = defaultLayerOptions.isLocked

Whether this layer has been marked as locked.

This property is not used within nbs.js for anything other than storage.

It only exists to work with other applications that implement functionality.

isSolo: boolean = defaultLayerOptions.isSolo

Whether this layer has been marked as solo.

This property is not used within nbs.js for anything other than storage.

It only exists to work with other applications that implement functionality.

name: string = defaultLayerOptions.name

Name of the layer.

notes: LayerNotes = ...

Array of every note in the layer.

stereo: number = defaultLayerOptions.stereo

How much this layer is panned to the left or right.

-100 is 2 blocks right, 0 is center, 100 is 2 blocks left.
volume: number = defaultLayerOptions.volume

Volume percentage of the layer.

Constructors