Extends
Methods
clone() → {Note}
A deep copy of the current object.
Returns:
- Type
- Note
getAttributes() → {object}
Get an object holding note properties. The object has the following properties.
tF0Offset
:number
pitch transition - offset (seconds)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)pF0Vbr
:number
vibrato - phase (radian, from -π to π)fF0Vbr
:number
vibrato - frequency (Hz)tNoteOffset
:number
timing and phonemes - note offset (seconds)exprGroup
(optional):string
expression groupdur
: array ofnumber
for phoneme duration scalingalt
: array ofnumber
for phoneme alternative pronunciation
For numeric properties, the value is NaN if the note uses the
default value based on the NoteGroupReference
it is
in.
Returns:
- Type
- object
getDuration() → {number}
Get the duration of the note. The unit is blicks.
Returns:
- Type
- number
getEnd() → {number}
Get the end position (start + duration) of the note. The unit is blicks.
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
getLyrics() → {string}
Get the lyrics for this note.
Returns:
- Type
- string
getOnset() → {number}
Get the start position of the note. The unit is blicks.
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
getPhonemes() → {string}
Returns the user-specified phonemes, delimited by spaces. For example, "hh ah ll ow".
If there's no phoneme specified, this will return an empty
string, instead of the default pronunciation (see SV#getPhonemesForGroup
).
Returns:
- Type
- string
getPitch() → {number}
Get the pitch as a MIDI number. C4 maps to 60.
Returns:
- Type
- number
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
setAttributes(object)
Set note properties based on an attribute object. The attribute object does not have to be complete; only the given properties will be updated. For example,
note.setAttributes({
"tF0Offset" : 0.05,
"exprGroup" : "C4",
"alt" : [0, 1]
});
Parameters:
Name | Type | Description |
---|---|---|
object |
attributes |
For the definition, see |
setDuration(t)
Resize the note to duration t
. The unit is blicks.
This changes the end as well, but not the onset.
Parameters:
Name | Type | Description |
---|---|---|
t |
number |
setLyrics(lyrics)
Change the lyrics.
Parameters:
Name | Type | Description |
---|---|---|
lyrics |
string |
setOnset(t)
Move the note to start at t
. The unit is blicks.
This does not change the duration.
Parameters:
Name | Type | Description |
---|---|---|
t |
number |
setPhonemes(phoneme_str)
Change the phonemes to phoneme_str
. For example,
"hh ah ll ow".
Parameters:
Name | Type | Description |
---|---|---|
phoneme_str |
string |
A space-delimited list of phonemes. |
setPitch(pitchNumber)
Set the note pitch to pitchNumber
, a MIDI
number.
Parameters:
Name | Type | Description |
---|---|---|
pitchNumber |
number |
setTimeRange(onset, duration)
Set both onset and duration. This is a shorthand for calling
setOnset(onset)
and
setDuration(duration)
.
Parameters:
Name | Type | Description |
---|---|---|
onset |
number | |
duration |
number |