From 18337f0c6784f37ee6e2507948984e580d6126d8 Mon Sep 17 00:00:00 2001 From: encode42 Date: Sat, 21 Sep 2024 16:56:09 -0400 Subject: [PATCH] Finishing touches for v6 --- package.json | 2 +- public/docs/dev/classes/BufferReader.html | 22 ++++---- public/docs/dev/classes/BufferWrapper.html | 12 ++--- public/docs/dev/classes/BufferWriter.html | 20 ++++---- public/docs/dev/classes/Instrument.html | 16 +++--- public/docs/dev/classes/Layer.html | 14 +++--- public/docs/dev/classes/LayerNotes.html | 18 +++---- public/docs/dev/classes/Note.html | 14 +++--- public/docs/dev/classes/Song.html | 50 +++++++++---------- public/docs/dev/classes/SongInstruments.html | 18 +++---- public/docs/dev/classes/SongLayers.html | 14 +++--- .../docs/dev/functions/fromArrayBuffer.html | 2 +- .../docs/dev/functions/omitEmptyLayers.html | 2 +- public/docs/dev/functions/toArrayBuffer.html | 2 +- .../docs/dev/interfaces/BuiltInBuilder.html | 2 +- .../dev/interfaces/ExistingInstruments.html | 2 +- public/docs/dev/interfaces/ExistingNotes.html | 2 +- .../interfaces/FromArrayBufferOptions.html | 4 +- .../dev/interfaces/InstrumentOptions.html | 10 ++-- public/docs/dev/interfaces/LayerOptions.html | 12 ++--- public/docs/dev/interfaces/NoteOptions.html | 10 ++-- public/docs/dev/interfaces/SongAutoSave.html | 6 +-- public/docs/dev/interfaces/SongLoop.html | 8 +-- .../dev/interfaces/ToArrayBufferOptions.html | 4 +- public/docs/dev/types/BuiltIn.html | 2 +- .../docs/dev/variables/builtInBuilder-1.html | 2 +- .../docs/dev/variables/defaultAutoSave.html | 2 +- .../defaultFromArrayBufferOptions.html | 2 +- .../variables/defaultInstrumentOptions.html | 2 +- .../dev/variables/defaultLayerOptions.html | 2 +- public/docs/dev/variables/defaultLoop.html | 2 +- .../dev/variables/defaultNoteOptions.html | 2 +- .../defaultToArrayBufferOptions.html | 2 +- tsconfig.json | 3 +- 34 files changed, 143 insertions(+), 144 deletions(-) diff --git a/package.json b/package.json index 002795e..df88284 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "build": "bun run build:bundle && bun run build:docs", "build:bundle": "bun build.ts", "build:docs": "typedoc", - "publish": "bun run test && bun run build && npm publish" + "build:publish": "bun run test && bun run build && npm publish" }, "engines": { "node": ">=18" diff --git a/public/docs/dev/classes/BufferReader.html b/public/docs/dev/classes/BufferReader.html index 0f55e1b..da1c84b 100644 --- a/public/docs/dev/classes/BufferReader.html +++ b/public/docs/dev/classes/BufferReader.html @@ -157,7 +157,7 @@ --md-sys-color-surface-container-highest: #e7e1e5 }

Class BufferReaderInternal

Represents an ArrayBuffer reader.

-

Hierarchy (view full)

Properties

Hierarchy (view full)

Properties

Methods

readByte @@ -168,19 +168,19 @@ resize

Constructors

Properties

buffer: ArrayBufferLike

Buffer that is being read.

-
nextByte: number = 0

Next byte to read.

-
viewer: DataView

Data view for the buffer.

-

Methods

  • Read the next unsigned byte.

    -

    Returns number

nextByte: number = 0

Next byte to read.

+
viewer: DataView

Data view for the buffer.

+

Methods

  • Read the next unsigned byte.

    +

    Returns number

  • Resize the ArrayBuffer and increment the next byte.

    Parameters

    • by: number

      The amount of bytes to increment by

    Returns number

    The byte that now has by bytes to write to.

    -

Constructors

Constructors

Class BufferWrapperInternal

A buffer object wrapper.

-

Hierarchy (view full)

Properties

Hierarchy (view full)

Properties

Methods

Constructors

Properties

buffer: ArrayBufferLike

Buffer that is being read.

-
nextByte: number = 0

Next byte to read.

-
viewer: DataView

Data view for the buffer.

-

Methods

  • Resize the ArrayBuffer and increment the next byte.

    +
nextByte: number = 0

Next byte to read.

+
viewer: DataView

Data view for the buffer.

+

Methods

  • Resize the ArrayBuffer and increment the next byte.

    Parameters

    • by: number

      The amount of bytes to increment by

    Returns number

    The byte that now has by bytes to write to.

    -

Constructors

Constructors

Class BufferWriterInternal

Represents an ArrayBuffer writer.

-

Hierarchy (view full)

Properties

Hierarchy (view full)

Properties

Methods

writeByte @@ -168,17 +168,17 @@ resize

Constructors

Properties

buffer: ArrayBufferLike

Buffer that is being read.

-
nextByte: number = 0

Next byte to read.

-
viewer: DataView

Data view for the buffer.

-

Methods

  • Write a byte.

    -

    Parameters

    • value: number = 0

    Returns void

  • Write an integer.

    -

    Parameters

    • value: number = 0

    Returns void

  • Write a short.

    -

    Parameters

    • value: number = 0

    Returns void

  • Write a string.

    -

    Parameters

    • value: string = ""

    Returns void

  • Write an unsigned byte.

    -

    Parameters

    • value: number = 0

    Returns void

nextByte: number = 0

Next byte to read.

+
viewer: DataView

Data view for the buffer.

+

Methods

  • Write a byte.

    +

    Parameters

    • value: number = 0

    Returns void

  • Write an integer.

    +

    Parameters

    • value: number = 0

    Returns void

  • Write a short.

    +

    Parameters

    • value: number = 0

    Returns void

  • Write a string.

    +

    Parameters

    • value: string = ""

    Returns void

  • Write an unsigned byte.

    +

    Parameters

    • value: number = 0

    Returns void

  • Resize the ArrayBuffer and increment the next byte.

    Parameters

    • by: number

      The amount of bytes to increment by

    Returns number

    The byte that now has by bytes to write to.

    -

Constructors

Class SongInstruments

Represents the Instruments of a Song with helper methods.

-

Properties

all +

Properties

Methods

[iterator] add @@ -169,27 +169,27 @@

Properties

ID-instrument pair of the song's instruments.

Currently, this always includes the built-in instruments from Note Block Studio v5.

This should not be modified directly! Instead, utilize the various helper methods in this class.

-
firstCustomIndex: number = ...

The ID of the first custom instrument.

-

Methods

firstCustomIndex: number = ...

The ID of the first custom instrument.

+

Methods

Returns Instrument

Returns Instrument

  • Delete an Instrument.

    Parameters

    • id: number

      ID of the instrument to be deleted

    Returns void

    Does not protect built-in instruments. This may not be desirable!

    According to the NBS specification, instrument IDs must be consecutive! Make sure to update any proceeding instrument IDs.

    -
  • Set an existing Instrument at an ID.

    Parameters

    • id: number

      ID of the instrument to be set

    • instrument: Instrument

      The instrument to set at id.

    Returns Instrument

    Any existing instrument with the same ID as the added instrument will be overwritten. This includes built-in instruments, which may not be desirable!

    According to the NBS specification, instrument IDs must be consecutive!

    -

Constructors

Interface FromArrayBufferOptionsInternal

Options for fromArrayBuffer.

-
interface FromArrayBufferOptions {
    ignoreEmptyLayers?: boolean;
}

Properties

interface FromArrayBufferOptions {
    ignoreEmptyLayers?: boolean;
}

Properties

ignoreEmptyLayers?: boolean

Whether to ignore (delete) unpopulated leading layers.

Note Block Studio automatically generates extra layers past the last populated layer.

This option skips those layers upon import.

-

Interface InstrumentOptions

Options available for an Instrument.

-
interface InstrumentOptions {
    key?: number;
    name?: string;
    pressKey?: boolean;
    soundFile?: string;
}

Properties

interface InstrumentOptions {
    key?: number;
    name?: string;
    pressKey?: boolean;
    soundFile?: string;
}

Properties

key?: number

Key of the sound file.

Just like note blocks, this ranges from 0-87.

-
name?: string

Name of the instrument.

-
pressKey?: boolean

Whether the on-screen piano should visually press keys when these notes are played.

-
soundFile?: string

Sound file of the instrument.

+
name?: string

Name of the instrument.

+
pressKey?: boolean

Whether the on-screen piano should visually press keys when these notes are played.

+
soundFile?: string

Sound file of the instrument.

Relative to the Data/Sounds/ directory of Note Block Studio installations.

-

Interface LayerOptions

Options available for a Layer.

-
interface LayerOptions {
    isLocked?: boolean;
    isSolo?: boolean;
    name?: string;
    stereo?: number;
    volume?: number;
}

Properties

interface LayerOptions {
    isLocked?: boolean;
    isSolo?: boolean;
    name?: string;
    stereo?: number;
    volume?: number;
}

Properties

isLocked?: boolean

Whether this layer has been marked as locked.

-
isSolo?: boolean

Whether this layer has been marked as solo.

-
name?: string

Name of the layer.

-
stereo?: number

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

-
volume?: number

Volume percentage of the layer.

-

Interface NoteOptions

Options available for a Note.

-
interface NoteOptions {
    key?: number;
    panning?: number;
    pitch?: number;
    velocity?: number;
}

Properties

interface NoteOptions {
    key?: number;
    panning?: number;
    pitch?: number;
    velocity?: number;
}

Properties

key?: number

Key of the note block.

From 0 to 87. 33 to 57 is within the 2-octave limit.

-
panning?: number

Stereo position of the note block.

+
panning?: number

Stereo position of the note block.

From -100 to 100.

-
pitch?: number

Fine pitch of the note block.

+
pitch?: number

Fine pitch of the note block.

The max in Note Block Studio is limited to -1200 and +1200.

-
velocity?: number

Velocity (volume) of the note block.

+
velocity?: number

Velocity (volume) of the note block.

From 0% to 100%.

-

Interface SongAutoSave

Options available for Song#autoSave.

These properties are not used within nbs.js for anything other than storage.

They only exist as data fields to work with other applications that implement functionality.

-
interface SongAutoSave {
    enabled: boolean;
    interval: number;
}

Properties

interface SongAutoSave {
    enabled: boolean;
    interval: number;
}

Properties

Properties

enabled: boolean

Whether auto-saving has been enabled.

-
interval: number

Number of minutes between each auto-save.

+
interval: number

Number of minutes between each auto-save.

Ranges from 1 to 60.

-

Interface SongLoop

Options available for Song#loop.

These properties are not used within nbs.js for anything other than storage.

They only exist as data fields to work with other applications that implement functionality.

-
interface SongLoop {
    enabled: boolean;
    startTick: number;
    totalLoops: number;
}

Properties

interface SongLoop {
    enabled: boolean;
    startTick: number;
    totalLoops: number;
}

Properties

enabled: boolean

Whether looping is enabled.

-
startTick: number

Where the song should loop back to.

+
startTick: number

Where the song should loop back to.

Unit is ticks.

-
totalLoops: number

Number of times the song should loop.

+
totalLoops: number

Number of times the song should loop.

0 designates infinite.

-

Interface ToArrayBufferOptionsInternal

Options for toArrayBuffer.

-
interface ToArrayBufferOptions {
    ignoreEmptyLayers?: boolean;
}

Properties

interface ToArrayBufferOptions {
    ignoreEmptyLayers?: boolean;
}

Properties

ignoreEmptyLayers?: boolean

Whether to ignore unpopulated leading layers.

This skips all layers without notes from the exported song.

-

Type Alias BuiltIn

BuiltIn: {
    [Id in keyof typeof builtInBuilder]: Instrument
}

Every built-in instrument.

Variable builtInBuilderConst Internal

builtInBuilder: BuiltInBuilder = ...

Used to construct Instrument.builtIn.

-

Variable defaultAutoSaveConst Internal

defaultAutoSave: SongAutoSave = ...

Default Song#autoSave values.

-

Variable defaultFromArrayBufferOptionsConst Internal

defaultFromArrayBufferOptions: FromArrayBufferOptions = ...

Default options for fromArrayBuffer.

-

Variable defaultInstrumentOptionsConst

defaultInstrumentOptions: InstrumentOptions = ...

Default Instrument values.

-

Variable defaultLayerOptionsConst Internal

defaultLayerOptions: Required<LayerOptions> = ...

Default Layer values.

-

Variable defaultLoopConst Internal

defaultLoop: SongLoop = ...

Default Song#loop values.

-

Variable defaultNoteOptionsConst Internal

defaultNoteOptions: Required<NoteOptions> = ...

Default NoteOptions values.

-

Variable defaultToArrayBufferOptionsConst Internal

defaultToArrayBufferOptions: ToArrayBufferOptions = ...

Default options for toArrayBuffer.

-