Note Object

更新於4年前

This documentation applies to plugins for 1.x only!


Documentation for 2.x+ is built into the Plugin Creator of Musescore.

( ⇒ In Musescore press Ctrl+Shift+P, then F1 to bring it up. )


Click here for Documentation for 3.x



Represents a single note. Notes belong to Chord Object objects.

A new Note can be created with:
  note = new Note();
or
  note = new Note(score);
where score is a Score Object object.

Notes belonging to a given Chord can be accessed with the Chord.note(index) and Chord.topNote() methods of the Chord object.

See also:

Chord Object , Score Object .

Properties

Name Type Description
boundingRect rect the bounding rectangle of the note relative to ???; in raster units (read-only).
color QColor the colour of the note head.
name string the name of the note as a string (read-only).
noteHead integer the note head group (see table below).
pitch integer the MIDI pitch of the note (in the range 0-127).
pos pos the position of the note relative to the page; in raster unit (read-only).
tied integer 0: not tied
1: tied to next note
2: tied to previous note
3: tied to both previous and next note.
tpc integer the Tonal Pitch Class enum of the note.
tuning integer the tuning adjustment of the note, in +/-cent with respect to default tuning.
visible bool whether the note is visible or not.
userAccidental integer the user-added accidental (see table below), if any; only affected by accidentals which do not change the MIDI pitch, like courtesy accidentals or micro-interval accidentals; if a note only has an accidental which can be deducted from the tpc property, returns 0.
velocity integer the MIDI velocity (loudness) of the note (in the range 0-127).

Methods

None.

Addendum 1: Codes for accidentals

These are the values returned by the userAccidental property.

none 0
# 1 mirrored-flat-slash 10 flat arrow up 19
b 2 flat-flat-slash 11 flat arrow down 20
## 3 sharp-slash 12 flat arrow both 21
bb 4 sharp-slash2 13 natural arrow up 22
natural 5 sharp-slash3 14 natural arrow down 23
flat-slash 6 sharp-slash4 15 natural arrow both 24
flat-slash2 7 sharp arrow up 16 sori 25
mirrored-flat2 8 sharp arrow down 17 koron 26
mirrored-flat 9 sharp arrow both 18

Addendum 2: Codes for note head

These are the values used when reading from or writing to the noteHead property.

0 normal 7 do
1 cross 8 re
2 diamond 9 fa
3 triangle 10 la
4 mi 11 ti
5 slash 12 sol
6 X-circle 13 alt. brevis