Track

Track

A collection of NoteGroupReference. A Track also contains a NoteGroup which is the main group of the track. The first NoteGroupReference inside the track always refers to the main group.

The default voice properties of the Track is defined by the first NoteGroupReference (the main group).

Extends

Methods

addGroupReference(group) → {number}

Add a NoteGroupReference to this Track and return the index of the added group. It keeps all groups sorted by onset position.

Parameters:
Name Type Description
group NoteGroupReference
Returns:
Type
number

clone() → {Track}

A deep copy of the current object.

Returns:
Type
Track

getDisplayColor() → {string}

Get the track's color as a hex string.

Returns:
Type
string

getDisplayOrder() → {number}

Get the display order of the track inside the parent Project. A track's display order can be different from its storage index. The order of tracks as displayed in arrangement view is always based on the display order.

Returns:
Type
number

getDuration() → {number}

Get the duration of the Track in blicks, defined as the ending position of the last NoteGroupReference.

Returns:
Type
number

getGroupReference(index) → {NoteGroupReference}

Get the index-th NoteGroupReference. The first is always the main group, followed by groups that refer to NoteGroup in the project library. The groups are sorted in ascending onset positions.

Parameters:
Name Type Description
index number
Returns:
Type
NoteGroupReference

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 track name.

Returns:
Type
string

getNumGroups() → {number}

Get the number of NoteGroupReference in this Track, including the main group.

Returns:
Type
number

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

isBounced() → {boolean}

An option for whether or not to be exported to files, shown in Render Panel.

Returns:
Type
boolean

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

removeGroupReference(index)

Remove the index-th NoteGroupReference from this Track.

Parameters:
Name Type Description
index number

setBounced(enabled)

Set whether or not to have the Track exported to files. See Track#isBounced.

Parameters:
Name Type Description
enabled boolean

setDisplayColor(colorStr)

Set the display color of the Track to a hex string.

Parameters:
Name Type Description
colorStr string

setName(name)

Set the name of the Track.

Parameters:
Name Type Description
name string