RelativeChord::RelativeChord(const Key& inKey, const Chord& inChord) : m_RootInterval(inKey.tonic(), inChord.root()), m_Type(inChord.type()) { if (inChord == Chord::silence()) { *this = silence(); } else if (inChord == Chord::none()) { *this = none(); } else if (inChord == Chord::undefined()) { *this = unknown(); } if (inKey == Key::silence()) { std::runtime_error("Cannot deduce relative chord when key is silence"); } }
RelativeChord Key::relativeChord(const Chord& inChord) const { return RelativeChord(Interval(tonic(), inChord.root()), inChord.type()); }