Lomse library. API documentation  0.30.0
DiatonicPitch Class Reference

#include <lomse_pitch.h>

Detailed Description

Class DiatonicPitch represents the note in a diatonic scale. Only Step and Octave information. It has the following properties:

  • It is a very compact representation (just an int number).
  • Accidentals are not represented. Incomplete information.
  • Useful for sweeps along the diatonic notes range.

Public Member Functions

 DiatonicPitch (int value)
 
 DiatonicPitch (int step, int octave)
 
 DiatonicPitch ()
 
 ~DiatonicPitch ()
 
 operator int ()
 
DiatonicPitch operator- (int i)
 
DiatonicPitch operator+ (int i)
 
DiatonicPitch operator-= (int i)
 
DiatonicPitch operator+= (int i)
 
MidiPitch to_midi_pitch ()
 
FPitch to_FPitch (EKeySignature nKey)
 
string get_english_note_name ()
 
string get_ldp_name ()
 
int step ()
 
int octave ()
 
bool operator== (DiatonicPitch dp)
 
bool operator!= (DiatonicPitch dp)
 
bool operator< (DiatonicPitch dp)
 
bool operator> (DiatonicPitch dp)
 
bool operator<= (DiatonicPitch dp)
 
bool operator>= (DiatonicPitch dp)
 

Constructor & Destructor Documentation

◆ DiatonicPitch() [1/3]

DiatonicPitch::DiatonicPitch ( int  value)
inline

Constructor from an int value representing a DiatonicPitch.

◆ DiatonicPitch() [2/3]

DiatonicPitch::DiatonicPitch ( int  step,
int  octave 
)

Constructor from pitch components.

◆ DiatonicPitch() [3/3]

DiatonicPitch::DiatonicPitch ( )
inline

Default constructor. Invalid pitch.

◆ ~DiatonicPitch()

DiatonicPitch::~DiatonicPitch ( )
inline

Destructor.

Member Function Documentation

◆ get_english_note_name()

string DiatonicPitch::get_english_note_name ( )

Pitch conversion to other formats.

◆ get_ldp_name()

string DiatonicPitch::get_ldp_name ( )

Pitch conversion to other formats.

◆ octave()

int DiatonicPitch::octave ( )
inline

Components extraction

◆ operator int()

DiatonicPitch::operator int ( )
inline

Operator to cast to an int.

◆ operator!=()

bool DiatonicPitch::operator!= ( DiatonicPitch  dp)
inline

Comparison operators

◆ operator+()

DiatonicPitch DiatonicPitch::operator+ ( int  i)
inline

Increment / decrement pitch by a certain number of steps.

◆ operator+=()

DiatonicPitch DiatonicPitch::operator+= ( int  i)
inline

Increment / decrement pitch by a certain number of steps.

◆ operator-()

DiatonicPitch DiatonicPitch::operator- ( int  i)
inline

Increment / decrement pitch by a certain number of steps.

◆ operator-=()

DiatonicPitch DiatonicPitch::operator-= ( int  i)
inline

Increment / decrement pitch by a certain number of steps.

◆ operator<()

bool DiatonicPitch::operator< ( DiatonicPitch  dp)
inline

Comparison operators

◆ operator<=()

bool DiatonicPitch::operator<= ( DiatonicPitch  dp)
inline

Comparison operators

◆ operator==()

bool DiatonicPitch::operator== ( DiatonicPitch  dp)
inline

Comparison operators

◆ operator>()

bool DiatonicPitch::operator> ( DiatonicPitch  dp)
inline

Comparison operators

◆ operator>=()

bool DiatonicPitch::operator>= ( DiatonicPitch  dp)
inline

Comparison operators

◆ step()

int DiatonicPitch::step ( )
inline

Components extraction

◆ to_FPitch()

FPitch DiatonicPitch::to_FPitch ( EKeySignature  nKey)

Pitch conversion to other formats.

◆ to_midi_pitch()

MidiPitch DiatonicPitch::to_midi_pitch ( )

Pitch conversion to other formats.