SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::MIDI::Note Class Reference

A MIDI note representation. More...

#include <Note.hpp>

Public Member Functions

 Note (short value)
 Construct new note. More...
 
short octave () const
 
bool accented () const
 
std::string label () const
 
short value () const
 
bool operator== (const Note &rhs) const
 
bool operator!= (const Note &rhs) const
 
bool operator<= (const Note &rhs) const
 
bool operator>= (const Note &rhs) const
 
bool operator< (const Note &rhs) const
 
bool operator> (const Note &rhs) const
 
 operator int () const
 

Static Public Attributes

constexpr static short Min = 0
 
constexpr static short Max = 127
 

Detailed Description

A MIDI note representation.

MIDI note values range from 0 to 255, and so does this.

Constructor & Destructor Documentation

◆ Note()

SF2::MIDI::Note::Note ( short  value)
inlineexplicit

Construct new note.

Parameters
valuethe MIDI value to represent

References value().

Member Function Documentation

◆ accented()

bool SF2::MIDI::Note::accented ( ) const
inline
Returns
true if the note is accented (sharp / flat)

Referenced by label().

◆ label()

std::string SF2::MIDI::Note::label ( ) const
inline
Returns
textual representation of the note (shows a sharp for accented notes)

References accented(), and octave().

◆ octave()

short SF2::MIDI::Note::octave ( ) const
inline
Returns
the octave that the note resides in

Referenced by label().

◆ operator int()

SF2::MIDI::Note::operator int ( ) const
inline

References value().

◆ operator!=()

bool SF2::MIDI::Note::operator!= ( const Note rhs) const
inline

◆ operator<()

bool SF2::MIDI::Note::operator< ( const Note rhs) const
inline

◆ operator<=()

bool SF2::MIDI::Note::operator<= ( const Note rhs) const
inline

◆ operator==()

bool SF2::MIDI::Note::operator== ( const Note rhs) const
inline

◆ operator>()

bool SF2::MIDI::Note::operator> ( const Note rhs) const
inline

◆ operator>=()

bool SF2::MIDI::Note::operator>= ( const Note rhs) const
inline

◆ value()

short SF2::MIDI::Note::value ( ) const
inline

Referenced by Note(), and operator int().

Member Data Documentation

◆ Max

constexpr static short SF2::MIDI::Note::Max = 127
inlinestaticconstexpr

◆ Min

constexpr static short SF2::MIDI::Note::Min = 0
inlinestaticconstexpr

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