Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CADiatonicPitch Class Reference

Musical note pitch. More...

#include <diatonicpitch.h>

Public Types

enum  CANoteName {
  Undefined = -1, C = 0, D = 1, E = 2,
  F = 3, G = 4, A = 5, B = 6
}
 

Public Member Functions

 CADiatonicPitch ()
 
 CADiatonicPitch (const QString &pitch)
 
 CADiatonicPitch (const int &noteName, const int &accs=0)
 
bool operator== (CADiatonicPitch)
 
bool operator!= (CADiatonicPitch p)
 
bool operator== (int noteName)
 
bool operator!= (int p)
 
CADiatonicPitch operator+ (CAInterval)
 
CADiatonicPitch operator- (CAInterval i)
 
const int noteName ()
 
const int accs ()
 
void setNoteName (const int noteName)
 
void setAccs (const int accs)
 

Static Public Member Functions

static const QString diatonicPitchToString (CADiatonicPitch p)
 
static CADiatonicPitch diatonicPitchFromString (const QString s)
 

Private Attributes

int _noteName
 
int _accs
 

Detailed Description

Musical note pitch.

Copyright (c) 2008, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

Copyright (c) 2008, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

This is a typical music presentation of the note pitch.

It consists of two properties:

Note name begins with sub-contra C.

Diatonic pitches can be compared with each other or only note names and summed with intervals.

See Also
CAInterval, operator+(), CAMidiDevice::diatonicPitchToMidi()

Member Enumeration Documentation

Enumerator
Undefined 
C 
D 
E 
F 
G 
A 
B 

Constructor & Destructor Documentation

CADiatonicPitch::CADiatonicPitch ( )

References setAccs(), setNoteName(), and Undefined.

Referenced by diatonicPitchFromString().

Here is the call graph for this function:

Here is the caller graph for this function:

CADiatonicPitch::CADiatonicPitch ( const QString &  pitch)

References noteName(), setAccs(), and setNoteName().

Here is the call graph for this function:

CADiatonicPitch::CADiatonicPitch ( const int &  noteName,
const int &  accs = 0 
)

References setAccs(), and setNoteName().

Here is the call graph for this function:

Member Function Documentation

const int CADiatonicPitch::accs ( )
inline
CADiatonicPitch CADiatonicPitch::diatonicPitchFromString ( const QString  s)
static

Creates a new diatonic pitch from the given string.

References CADiatonicPitch().

Referenced by CAMusicXmlImport::readNote().

Here is the call graph for this function:

Here is the caller graph for this function:

const QString CADiatonicPitch::diatonicPitchToString ( CADiatonicPitch  pitch)
static

Converts the music pitch to string.

References accs(), and noteName().

Here is the call graph for this function:

const int CADiatonicPitch::noteName ( )
inline
bool CADiatonicPitch::operator!= ( CADiatonicPitch  p)
inline

References operator==().

Here is the call graph for this function:

bool CADiatonicPitch::operator!= ( int  p)
inline

References operator==().

Here is the call graph for this function:

CADiatonicPitch CADiatonicPitch::operator+ ( CAInterval  i)

Calculates the new pitch using the old pitch + interval.

References accs(), CAInterval::Fifth, CAInterval::Fourth, noteName(), CAInterval::Prime, CAInterval::quality(), CAInterval::quantity(), CAInterval::Second, setAccs(), setNoteName(), CAInterval::Seventh, CAInterval::Sixth, and CAInterval::Third.

Referenced by operator-().

Here is the call graph for this function:

Here is the caller graph for this function:

CADiatonicPitch CADiatonicPitch::operator- ( CAInterval  i)
inline

References operator+(), CAInterval::quality(), and CAInterval::quantity().

Here is the call graph for this function:

bool CADiatonicPitch::operator== ( CADiatonicPitch  p)

References accs(), and noteName().

Referenced by operator!=().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CADiatonicPitch::operator== ( int  noteName)

References noteName().

Here is the call graph for this function:

void CADiatonicPitch::setAccs ( const int  accs)
inline

References _accs, and accs().

Referenced by CADiatonicPitch(), CAMidiDevice::midiPitchToDiatonicPitch(), operator+(), and CAMusicXmlImport::readNote().

Here is the call graph for this function:

Here is the caller graph for this function:

void CADiatonicPitch::setNoteName ( const int  noteName)
inline

References _noteName, and noteName().

Referenced by CADiatonicPitch(), CAMidiDevice::midiPitchToDiatonicPitch(), operator+(), CADiatonicKey::operator+(), CAMusicXmlImport::readNote(), and CALilyPondExport::writeRelativeIntro().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int CADiatonicPitch::_accs
private

Referenced by accs(), and setAccs().

int CADiatonicPitch::_noteName
private

Referenced by noteName(), and setNoteName().


The documentation for this class was generated from the following files: