NoteGroup

NoteGroup

A set of notes (Note) and parameters (Automation) grouped together for convenient reuse.

To put a NoteGroup inside a Track, it has to be wrapped in a NoteGroupReference which provides the context (e.g. voice, language, time and pitch offset) for the group.

Extends

Methods

addNote(note) → {number}

Add a note to this NoteGroup and return the index of the added note. The notes are kept sorted by ascending onset positions.

Parameters:
Name Type Description
note Note
Returns:
Type
number

clone() → {NoteGroup}

A deep copy of the current object.

Returns:
Type
NoteGroup

getIndexInParent() → {number}

Inherited From:

Get index of the current object in its parent. In Lua, this index starts from 1. In JavaScript, this index starts from 0.

Returns:
Type
number

getName() → {string}

Get the user-specified name of this NoteGroup.

Returns:
Type
string

getNote(index) → {Note}

Get the note at index. The notes inside a NoteGroup are always sorted by onset positions.

Parameters:
Name Type Description
index number
Returns:
Type
Note

getNumNotes() → {number}

Get the number of notes in the NoteGroup.

Returns:
Type
number

getParameter(type) → {Automation}

Get the Automation object for parameter type. It is case-insensitive.

type should be one of the strings in the typeName column in the table shown in Automation#getDefinition.

Parameters:
Name Type Description
type string
Returns:
Type
Automation

getParent() → {NestedObject|undefined}

Inherited From:

Get the parent NestedObject. Return undefined if the current object is not attached to a parent.

Returns:
Type
NestedObject | undefined

getUUID() → {string}

Get the Universally Unique Identifier. Unlike the name, a UUID is unique across the project and can be used to associate a NoteGroupReference with a NoteGroup.

A UUID looks like this: "ab85d637-d80b-4628-9c27-007ea74029af".

Returns:
Type
string

isMemoryManaged() → {boolean}

Inherited From:

Check whether or not the current object is memory managed (i.e. garbage collected by the script environment).

Returns:
Type
boolean

removeNote(index)

Remove the note at index.

Parameters:
Name Type Description
index number

setName(name)

Set the name of this NoteGroup.

Parameters:
Name Type Description
name string