NoteGroupReference

NoteGroupReference

A reference to a NoteGroup with optional time and pitch offset and voice/database properties. It puts a NoteGroup in a language context so text-to-phoneme conversion and rendering are possible.

A NoteGroupReference is always placed inside a Track. A NoteGroup may be referenced by more than one NoteGroupReference.

Extends

Methods

clone() → {NoteGroupReference}

A deep copy of the current object.

Note: since NoteGroupReference does not take ownership of the target NoteGroup, this does not copy the target NoteGroup.

Returns:
Type
NoteGroupReference

getDuration() → {number}

The duration of this NoteGroupReference (blicks).

Equivalent to getEnd() - getOnset().

Returns:
Type
number

getEnd() → {number}

Get the ending position (blicks), that is, the end of the last note in the target NoteGroup plus the time offset.

If the NoteGroupReference holds an audio file (NoteGroupReference#isInstrumental), getEnd() will return the ending position (blicks) of the audio plus the time offset. However, if the NoteGroupReference is not placed inside a Project, there is not enough information to determine the audio's length in musical time units and getEnd() will assume that the duration is zero.

Returns:
Type
number

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

getOnset() → {number}

Get the beginning position (blicks), that is, the onset of the first Note in the target NoteGroup plus the time offset.

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

getPitchOffset() → {number}

Get the pitch shift (semitones) applied to all notes in the target NoteGroup}.

Returns:
Type
number

getTarget() → {NoteGroup}

Get the target NoteGroup.

Returns:
Type
NoteGroup

getTimeOffset() → {number}

Get the time offset (blicks) applied to all notes in the target NoteGroup.

Returns:
Type
number

getVoice() → {object}

Get an object holding the default voice properties for this group, similar to Note#getAttributes.

The object has the following properties.

  • paramLoudness: number parameters - loudness (dB)
  • paramTension: number parameters - tension
  • paramBreathiness: number parameters - breathiness
  • paramGender: number parameters - gender
  • paramToneShift: number parameters - tone shift
  • vocalModeParams: object vocal mode parameters (supported since 2.1.1)
    • Each key is a vocal mode name (e.g. "Soft", "Powerful")
    • Each value is an object with:
      • pitch: number pitch adjustment (0 to 150)
      • timbre: number timbre adjustment (0 to 150)
      • pronunciation: number pronunciation adjustment (0 to 150)

Properties only available in version 1:

  • tF0Left: number pitch transition - duration left (seconds)
  • tF0Right: number pitch transition - duration right (seconds)
  • dF0Left: number pitch transition - depth left (semitones)
  • dF0Right: number pitch transition - depth right (semitones)
  • tF0VbrStart: number vibrato - start (seconds)
  • tF0VbrLeft: number vibrato - left (seconds)
  • tF0VbrRight: number vibrato - right (seconds)
  • dF0Vbr: number vibrato - depth (semitones)
  • fF0Vbr: number vibrato - frequency (Hz)
Returns:
Type
object

isInstrumental() → {boolean}

Whether this NoteGroupReference refers to an external audio file. If so, it must not refer to a NoteGroup.

Returns:
Type
boolean

isMain() → {boolean}

Whether this NoteGroupReference refers to the parent Track's main group.

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

isMuted() → {boolean}

Check if this group is muted.

(supported since 2.1.1)

Returns:
Type
boolean

setMuted(muted)

Set the mute status of this group.

When a group is muted, it will not contribute to the audio output during playback.

(supported since 2.1.1)

Parameters:
Name Type Description
muted boolean

setPitchOffset(pitchOffset)

Set the pitch offset to pitchOffset (semitones).

Parameters:
Name Type Description
pitchOffset number

setTarget(group)

Set the target NoteGroup.

Note that once set, the target can't be changed.

Parameters:
Name Type Description
group NoteGroup

setTimeOffset(blickOffset)

Set the time offset to blickOffset (blicks).

Parameters:
Name Type Description
blickOffset number

setTimeRange(onset, duration)

Set the absolute onset and duration of a group. This does not affect the time offset and can be used to shorten or extend a group from either left or right.

(supported since 2.1.0)

Parameters:
Name Type Description
onset number
duration number

setVoice(attributes)

Set voice properties based on an attribute object (for the definition, see NoteGroupReference#getVoice). The attribute object does not have to be complete; only the given properties will be updated (see Note#setAttributes).

Parameters:
Name Type Description
attributes object