Planeshift
|
A single note in a musical score. More...
#include <pawssheetline.h>
Classes | |
class | NoteContext |
Used to keep track of previous altered notes in the current measure. More... | |
Public Member Functions | |
char | GetName () const |
Get the note name. | |
int | GetOctave () const |
Get the note octave number. | |
psMusic::Accidental | GetPlayedAccidental (const ScoreContext &context) const |
Get the accidental of the played note. | |
psMusic::Accidental | GetWrittenAccidental () const |
Get the written accidental. | |
Note (short int position, short int alter) | |
Constructor. | |
Note (char name, int octave, psMusic::Accidental writtenAccidental) | |
Constructor. | |
Note () | |
Default constructor. | |
Note () | |
Constructor. | |
bool | operator== (const Note ¬e) const |
Equal operator. | |
void | SetName (char name) |
Set the note name. | |
void | SetOctave (int octave) |
Set the note octave number. | |
void | SetWrittenAccidental (psMusic::Accidental accidental) |
Set the written accidental. | |
csString | ToXML () |
Writes this note as a <pitch> XML node. | |
Public Attributes | |
short int | alter |
The note's alteration (-1 flat, 0 normal, 1 sharp). | |
char * | flat |
the buffer of the flat note. | |
size_t | flatLength |
the length of the buffer of the flat note. | |
char * | normal |
the buffer of the unaltered note. | |
size_t | normalLength |
the length of the buffer of the unaltered note. | |
short int | position |
The note's position (0 is C4, 1 is D4 etc). | |
char * | sharp |
the buffer of the sharp note. | |
size_t | sharpLength |
the length of the buffer of the sharp note. |
A single note in a musical score.
This struct represents a musical note.
It keeps the stream buffer of the normal note, the sharp and the flat ones when available;
Definition at line 61 of file pawssheetline.h.
Constructor.
position | the note's position. |
alter | the note's alteration. |
Note::Note | ( | ) |
Default constructor.
Create a natural middle C.
Note::Note | ( | char | name, |
int | octave, | ||
psMusic::Accidental | writtenAccidental | ||
) |
Constructor.
name | Name of the note (C, D, E, F, G, A or B). Must be uppercase. |
octave | Octave number. Octave number 4 is the one that contains the central C on the piano. |
accidental | The accidental with which the note is written on the score. This is not related to the tonality of the piece but only on its representation. In other words the variable accidental must be different than UNALTERED if and only if an actual accidental is written on the musical score. |
Note::Note | ( | ) | [inline] |
char Note::GetName | ( | ) | const [inline] |
Get the note name.
Definition at line 133 of file scoreelements.h.
int Note::GetOctave | ( | ) | const [inline] |
Get the note octave number.
Definition at line 141 of file scoreelements.h.
psMusic::Accidental Note::GetPlayedAccidental | ( | const ScoreContext & | context | ) | const |
Get the accidental of the played note.
This takes into account the written accidental, the tonality and previous accidental in the same measure.
context | The context where tonality and previous accidentals are kept. |
psMusic::Accidental Note::GetWrittenAccidental | ( | ) | const [inline] |
Get the written accidental.
Definition at line 159 of file scoreelements.h.
bool Note::operator== | ( | const Note & | note | ) | const |
Equal operator.
note | The note to be compared with. |
void Note::SetName | ( | char | name | ) |
Set the note name.
name | The uppercase name of the note (C, D, E, F, G, A or B). |
void Note::SetOctave | ( | int | octave | ) |
Set the note octave number.
newOctave | The octave number of this note. Octave number 4 is the one that contains the central C on the piano. |
void Note::SetWrittenAccidental | ( | psMusic::Accidental | accidental | ) |
Set the written accidental.
accidental | The accidental written on the score for this note. |
csString Note::ToXML | ( | ) |
Writes this note as a <pitch> XML node.
short int Note::alter |
The note's alteration (-1 flat, 0 normal, 1 sharp).
Definition at line 64 of file pawssheetline.h.
char* Note::flat |
the buffer of the flat note.
Definition at line 44 of file instrument.h.
size_t Note::flatLength |
the length of the buffer of the flat note.
Definition at line 48 of file instrument.h.
char* Note::normal |
the buffer of the unaltered note.
Definition at line 42 of file instrument.h.
size_t Note::normalLength |
the length of the buffer of the unaltered note.
Definition at line 46 of file instrument.h.
short int Note::position |
The note's position (0 is C4, 1 is D4 etc).
Definition at line 63 of file pawssheetline.h.
char* Note::sharp |
the buffer of the sharp note.
Definition at line 43 of file instrument.h.
size_t Note::sharpLength |
the length of the buffer of the sharp note.
Definition at line 47 of file instrument.h.