Lomse library. API documentation
0.30.0
|
#include <lomse_pitch.h>
Class MidiPitch is just an int number representing the pitch in a chromatic scale. It is the same as the MIDI key number used in MIDI for representing pitch. It has the following properties:
Public Member Functions | |
MidiPitch (int note) | |
MidiPitch (int step, int octave, int acc=0) | |
operator int () | |
string | get_ldp_name () |
bool | is_natural_note_for (EKeySignature nKey) |
MidiPitch | operator- (int i) |
MidiPitch | operator+ (int i) |
MidiPitch | operator+= (int i) |
MidiPitch | operator-= (int i) |
int | octave (EKeySignature nKey) |
int | step (EKeySignature nKey) |
int | accidentals (EKeySignature nKey) |
void | get_components (EKeySignature nKey, int *step, int *octave, int *acc) |
|
inline |
Constructor from a MIDI value.
MidiPitch::MidiPitch | ( | int | step, |
int | octave, | ||
int | acc = 0 |
||
) |
Constructor from the pitch components.
int MidiPitch::accidentals | ( | EKeySignature | nKey | ) |
Components extraction
void MidiPitch::get_components | ( | EKeySignature | nKey, |
int * | step, | ||
int * | octave, | ||
int * | acc | ||
) |
Components extraction
string MidiPitch::get_ldp_name | ( | ) |
Returns the name of this pitch in LPD format, e.g., MidiPitch 60 will return "c4".
bool MidiPitch::is_natural_note_for | ( | EKeySignature | nKey | ) |
Returns TRUE if the pitch corresponds to a diatonic pitch in the given key signature.
int MidiPitch::octave | ( | EKeySignature | nKey | ) |
Components extraction
|
inline |
Operator to cast to an int.
|
inline |
Increment / decrement pitch by an arbitrary number of MIDI steps
|
inline |
Increment / decrement pitch by an arbitrary number of MIDI steps
|
inline |
Increment / decrement pitch by an arbitrary number of MIDI steps
|
inline |
Increment / decrement pitch by an arbitrary number of MIDI steps
int MidiPitch::step | ( | EKeySignature | nKey | ) |
Components extraction