XJ music engine  1.9.6
In-game runtime engine for XJ music.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
XJ::Chord Class Reference

#include <Chord.h>

Public Member Functions

bool operator< (const Chord &other) const
 
bool operator== (const Chord &other) const
 
 Chord (const std::string &input)
 
std::string toString () const
 
int delta (const Chord &target) const
 
std::string getName () const
 
PitchClass slashRootPitchClass ()
 
bool isNoChord () const
 
bool isAcceptable (const Chord &other) const
 
bool has_value () const
 

Static Public Member Functions

static std::string normalize (const std::string &input)
 
static Chord of (const std::string &name)
 

Public Attributes

std::string description
 
PitchClass root
 
SlashRoot slashRoot
 
Accidental accidental
 

Detailed Description

Chord in a particular key

Constructor & Destructor Documentation

◆ Chord()

Chord::Chord ( const std::string &  input)
explicit

Member Function Documentation

◆ delta()

int Chord::delta ( const Chord target) const

Delta to another Key calculated in +/- semitones

Parameters
targetkey to calculate delta to
Returns
delta +/- semitones to another key

◆ getName()

std::string Chord::getName ( ) const

Compute the name from the root pitch class and description

Returns
chord name

◆ has_value()

bool Chord::has_value ( ) const

Whether this Chord is null

Returns
true if non-null

◆ isAcceptable()

bool Chord::isAcceptable ( const Chord other) const

Whether one chord is acceptable as a substitute another

Parameters
otherchord to test
Returns
true if acceptable

◆ isNoChord()

bool Chord::isNoChord ( ) const

Whether this is a No Chord instance

Returns
true if No Chord

◆ normalize()

std::string Chord::normalize ( const std::string &  input)
static

Parse a chord description and return its most basic representation from the form dictionary

Parameters
inputto parse
Returns
most basic synonym, or original if already most basic

◆ of()

Chord Chord::of ( const std::string &  name)
static

Chord of a particular key, e.g. of("C minor 7")

Parameters
nameof Chord
Returns
new Chord

◆ operator<()

bool Chord::operator< ( const Chord other) const

◆ operator==()

bool Chord::operator== ( const Chord other) const

◆ slashRootPitchClass()

PitchClass Chord::slashRootPitchClass ( )

XJ understands the root of a slash chord https://www.pivotaltracker.com/story/show/176728338

◆ toString()

std::string Chord::toString ( ) const

std::string expression of interval pitch group, original name

Returns
scale as string

Member Data Documentation

◆ accidental

Accidental XJ::Chord::accidental

◆ description

std::string XJ::Chord::description

◆ root

PitchClass XJ::Chord::root

◆ slashRoot

SlashRoot XJ::Chord::slashRoot

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