diff --git a/Sources/Tonic/ChordType.swift b/Sources/Tonic/ChordType.swift index 3a6738f..e7e7f2e 100644 --- a/Sources/Tonic/ChordType.swift +++ b/Sources/Tonic/ChordType.swift @@ -148,53 +148,53 @@ public enum ChordType: String, CaseIterable, Codable { public var intervals: [Interval] { switch self { - case .majorTriad: return [.M3, .P5] - case .minorTriad: return [.m3, .P5] - case .diminishedTriad: return [.m3, .d5] - case .flatFive: return [.M3, .d5] - case .augmentedTriad: return [.M3, .A5] - case .suspendedSecondTriad: return [.M2, .P5] - case .suspendedFourthTriad: return [.P4, .P5] - case .sixth: return [.M3, .P5, .M6] - case .minorSixth: return [.m3, .P5, .M6] - case .halfDiminishedSeventh: return [.m3, .d5, .m7] - case .diminishedSeventh: return [.m3, .d5, .d7] - case .dominantSeventh: return [.M3, .P5, .m7] - case .dominantSeventhSuspendedFourth: return [.P4, .P5, .m7] - case .dominantSeventhSuspendedSecond: return [.M2, .P5, .m7] - case .majorSeventh: return [.M3, .P5, .M7] - case .minorSeventh: return [.m3, .P5, .m7] - case .minorMajorSeventh: return [.m3, .P5, .M7] - case .halfDiminishedNinth: return [.m3, .d5, .m7, .m9] - case .dominantNinth: return [.M3, .P5, .m7, .M9] - case .dominantNinthSuspendedFourth: return [.P4, .P5, .M9] - case .flatNinth: return [.M3, .P5, .m7, .m9] - case .sharpNinth: return [.M3, .P5, .m7, .A9] - case .majorNinth: return [.M3, .P5, .M7, .M9] - case .minorFlatNinth: return [.m3, .P5, .m7, .m9] - case .minorNinth: return [.m3, .P5, .m7, .M9] - case .majorAddNine: return [.M3, .P5, .M9] - case .minorAddNine: return [.m3, .P5, .M9] - case .sixOverNine: return [.M3, .P5, .M6, .M9] - case .majorEleventh: return [.M3, .P5, .M7, .M9, .P11] - case .dominantEleventh: return [.M3, .P5, .m7, .M9, .P11] - case .minorEleventh: return [.m3, .P5, .m7, .M9, .P11] - case .halfDiminishedEleventh: return [.m3, .d5, .m7, .m9, .P11] - case .majorSeventhFlatFifth: return [.M3, .d5, .M7] - case .minorSeventhSharpFifth: return [.M3, .A5, .M7] - case .majorNinthSharpEleventh: return [.M3, .P5, .M7, .M9, .A11] - case .dominantFlatNinthSharpEleventh: return [.M3, .P5, .m7, .m9, .A11] - case .dominantFlatFifth: return [.M3, .d5, .m7] - case .dominantSharpFifth: return [.M3, .A5, .m7] - case .dominantSharpNinthSharpEleventh: return [.M3, .P5, .m7, .A9, .A11] - case .minorSeventhFlatNinthAddEleventh: return [.m3, .P5, .m7, .m9, .P11] - case .majorThirteenth: return [.M3, .P5, .M7, .M9, .P11, .P13] - case .minorThirteenth: return [.m3, .P5, .m7, .M9, .P11, .P13] - case .minorFlatThirteenthFlatNinth: return [.m3, .P5, .m7, .m9, .P11, .d13] - case .majorThirteenthSharpEleventh: return [.M3, .P5, .M7, .M9, .A11, .P13] - case .dominantThirteenth: return [.M3, .P5, .m7, .M9, .P11, .P13] - case .minorEleventhFlatThirteenth: return [.m3, .P5, .m7, .M9, .P11, .d13] - case .halfDiminishedFlatThirteenth: return [.m3, .d5, .m7, .m9, .P11, .d13] + case .majorTriad: return [.M3, .P5] + case .minorTriad: return [.m3, .P5] + case .diminishedTriad: return [.m3, .d5] + case .flatFive: return [.M3, .d5] + case .augmentedTriad: return [.M3, .A5] + case .suspendedSecondTriad: return [.M2, .P5] + case .suspendedFourthTriad: return [.P4, .P5] + case .sixth: return [.M3, .P5, .M6] + case .minorSixth: return [.m3, .P5, .M6] + case .halfDiminishedSeventh: return [.m3, .d5, .m7] + case .diminishedSeventh: return [.m3, .d5, .d7] + case .dominantSeventh: return [.M3, .P5, .m7] + case .dominantSeventhSuspendedFourth: return [.P4, .P5, .m7] + case .dominantSeventhSuspendedSecond: return [.M2, .P5, .m7] + case .majorSeventh: return [.M3, .P5, .M7] + case .minorSeventh: return [.m3, .P5, .m7] + case .minorMajorSeventh: return [.m3, .P5, .M7] + case .halfDiminishedNinth: return [.m3, .d5, .m7, .m9] + case .dominantNinth: return [.M3, .P5, .m7, .M9] + case .dominantNinthSuspendedFourth: return [.P4, .P5, .M9] + case .flatNinth: return [.M3, .P5, .m7, .m9] + case .sharpNinth: return [.M3, .P5, .m7, .A9] + case .majorNinth: return [.M3, .P5, .M7, .M9] + case .minorFlatNinth: return [.m3, .P5, .m7, .m9] + case .minorNinth: return [.m3, .P5, .m7, .M9] + case .majorAddNine: return [.M3, .P5, .M9] + case .minorAddNine: return [.m3, .P5, .M9] + case .sixOverNine: return [.M3, .P5, .M6, .M9] + case .majorEleventh: return [.M3, .P5, .M7, .M9, .P11] + case .dominantEleventh: return [.M3, .P5, .m7, .M9, .P11] + case .minorEleventh: return [.m3, .P5, .m7, .M9, .P11] + case .halfDiminishedEleventh: return [.m3, .d5, .m7, .m9, .P11] + case .majorSeventhFlatFifth: return [.M3, .d5, .M7] + case .minorSeventhSharpFifth: return [.M3, .A5, .M7] + case .majorNinthSharpEleventh: return [.M3, .P5, .M7, .M9, .A11] + case .dominantFlatNinthSharpEleventh: return [.M3, .P5, .m7, .m9, .A11] + case .dominantFlatFifth: return [.M3, .d5, .m7] + case .dominantSharpFifth: return [.M3, .A5, .m7] + case .dominantSharpNinthSharpEleventh: return [.M3, .P5, .m7, .A9, .A11] + case .minorSeventhFlatNinthAddEleventh: return [.m3, .P5, .m7, .m9, .P11] + case .majorThirteenth: return [.M3, .P5, .M7, .M9, .P11, .M13] + case .minorThirteenth: return [.m3, .P5, .m7, .M9, .P11, .M13] + case .minorFlatThirteenthFlatNinth: return [.m3, .P5, .m7, .m9, .P11, .m13] + case .majorThirteenthSharpEleventh: return [.M3, .P5, .M7, .M9, .A11, .M13] + case .dominantThirteenth: return [.M3, .P5, .m7, .M9, .P11, .M13] + case .minorEleventhFlatThirteenth: return [.m3, .P5, .m7, .M9, .P11, .m13] + case .halfDiminishedFlatThirteenth: return [.m3, .d5, .m7, .m9, .P11, .m13] } } } @@ -203,108 +203,108 @@ extension ChordType: CustomStringConvertible { /// Adornment to the Root NoteClass (letter+accidental) that defines the chord type public var description: String { switch self { - case .majorTriad: return "" - case .minorTriad: return "m" - case .diminishedTriad: return "°" - case .flatFive: return "♭5" - case .augmentedTriad: return "⁺" - case .suspendedSecondTriad: return "sus2" - case .suspendedFourthTriad: return "sus4" - case .sixth: return "6" - case .minorSixth: return "m6" - case .halfDiminishedSeventh: return "ø7" - case .diminishedSeventh: return "°7" - case .dominantSeventh: return "7" - case .dominantSeventhSuspendedFourth: return "7sus4" - case .dominantSeventhSuspendedSecond: return "7sus2" - case .majorSeventh: return "maj7" - case .minorSeventh: return "m7" - case .minorMajorSeventh: return "mMaj7" - case .halfDiminishedNinth: return "ø9" - case .dominantNinth: return "9" - case .dominantNinthSuspendedFourth: return "9sus4" - case .flatNinth: return "7♭9" - case .sharpNinth: return "7♯9" - case .majorNinth: return "maj9" - case .minorFlatNinth: return "m7♭9" - case .minorNinth: return "m9" - case .majorAddNine: return "add9" - case .minorAddNine: return "mAdd9" - case .sixOverNine: return "6/9" - case .majorEleventh: return "maj11" - case .dominantEleventh: return "11" - case .minorEleventh: return "m11" - case .halfDiminishedEleventh: return "ø11" - case .majorSeventhFlatFifth: return "maj7♭5" - case .minorSeventhSharpFifth: return "maj7♯5" - case .majorNinthSharpEleventh: return "maj9♯11" - case .dominantFlatFifth: return "7♭5" - case .dominantSharpFifth: return "7♯5" - case .dominantFlatNinthSharpEleventh: return "7♭9♯11" - case .dominantSharpNinthSharpEleventh: return "7♯9♯11" - case .minorSeventhFlatNinthAddEleventh: return "m7♭9(add11)" - case .majorThirteenth: return "maj13" - case .minorThirteenth: return "m13" - case .minorFlatThirteenthFlatNinth: return "m♭13♭9" - case .majorThirteenthSharpEleventh: return "maj13♯11" - case .dominantThirteenth: return "13" - case .minorEleventhFlatThirteenth: return "m11♭13" - case .halfDiminishedFlatThirteenth: return "ø♭13" + case .majorTriad: return "" + case .minorTriad: return "m" + case .diminishedTriad: return "°" + case .flatFive: return "♭5" + case .augmentedTriad: return "⁺" + case .suspendedSecondTriad: return "sus2" + case .suspendedFourthTriad: return "sus4" + case .sixth: return "6" + case .minorSixth: return "m6" + case .halfDiminishedSeventh: return "ø7" + case .diminishedSeventh: return "°7" + case .dominantSeventh: return "7" + case .dominantSeventhSuspendedFourth: return "7sus4" + case .dominantSeventhSuspendedSecond: return "7sus2" + case .majorSeventh: return "maj7" + case .minorSeventh: return "m7" + case .minorMajorSeventh: return "mMaj7" + case .halfDiminishedNinth: return "ø9" + case .dominantNinth: return "9" + case .dominantNinthSuspendedFourth: return "9sus4" + case .flatNinth: return "7♭9" + case .sharpNinth: return "7♯9" + case .majorNinth: return "maj9" + case .minorFlatNinth: return "m7♭9" + case .minorNinth: return "m9" + case .majorAddNine: return "add9" + case .minorAddNine: return "mAdd9" + case .sixOverNine: return "6/9" + case .majorEleventh: return "maj11" + case .dominantEleventh: return "11" + case .minorEleventh: return "m11" + case .halfDiminishedEleventh: return "ø11" + case .majorSeventhFlatFifth: return "maj7♭5" + case .minorSeventhSharpFifth: return "maj7♯5" + case .majorNinthSharpEleventh: return "maj9♯11" + case .dominantFlatFifth: return "7♭5" + case .dominantSharpFifth: return "7♯5" + case .dominantFlatNinthSharpEleventh: return "7♭9♯11" + case .dominantSharpNinthSharpEleventh: return "7♯9♯11" + case .minorSeventhFlatNinthAddEleventh: return "m7♭9(add11)" + case .majorThirteenth: return "maj13" + case .minorThirteenth: return "m13" + case .minorFlatThirteenthFlatNinth: return "m♭13♭9" + case .majorThirteenthSharpEleventh: return "maj13♯11" + case .dominantThirteenth: return "13" + case .minorEleventhFlatThirteenth: return "m11♭13" + case .halfDiminishedFlatThirteenth: return "ø♭13" } } - - /// Adornment to the Root NoteClass (letter+accidental) that defines the chord type + + /// Adornment to the Root NoteClass (letter+accidental) that defines the chord type /// using specialized Chord Symbol Fonts Norfolk or Pori from /// NotationExpress: https://www.notationcentral.com/product/norfolk-fonts-for-sibelius/ public var chordFontDescription: String { switch self { - case .majorTriad: return "" - case .minorTriad: return "m" - case .diminishedTriad: return "º" - case .flatFive: return "b5" - case .augmentedTriad: return "&" - case .suspendedSecondTriad: return "“2" - case .suspendedFourthTriad: return "“4" - case .sixth: return "6" - case .minorSixth: return "m6" - case .halfDiminishedSeventh: return "Ø7" - case .diminishedSeventh: return "º7" - case .dominantSeventh: return "7" - case .dominantSeventhSuspendedFourth: return "7sus4" - case .dominantSeventhSuspendedSecond: return "7sus2" - case .majorSeventh: return "^7" - case .minorSeventh: return "m7" - case .minorMajorSeventh: return "m^7" - case .halfDiminishedNinth: return "Ø9" - case .dominantNinth: return "9" - case .dominantNinthSuspendedFourth: return "9sus4" - case .flatNinth: return "7b9" - case .sharpNinth: return "7#9" - case .majorNinth: return "^9" - case .minorFlatNinth: return "m7b9" - case .minorNinth: return "m9" - case .majorAddNine: return "@9" - case .minorAddNine: return "m@9" - case .sixOverNine: return "%" - case .majorEleventh: return "^11" - case .dominantEleventh: return "11" - case .minorEleventh: return "m11" - case .halfDiminishedEleventh: return "Ø11" - case .majorSeventhFlatFifth: return "^7b5" - case .minorSeventhSharpFifth: return "^7#5" - case .majorNinthSharpEleventh: return "^9#11" - case .dominantFlatFifth: return "7b5" - case .dominantSharpFifth: return "7#5" - case .dominantFlatNinthSharpEleventh: return "7âÅ" - case .dominantSharpNinthSharpEleventh: return "7åÅ" - case .minorSeventhFlatNinthAddEleventh: return "m7b9(@11)" - case .majorThirteenth: return "^13" - case .minorThirteenth: return "m13" - case .minorFlatThirteenthFlatNinth: return "máÆ" - case .majorThirteenthSharpEleventh: return "^13#11" - case .dominantThirteenth: return "13" - case .minorEleventhFlatThirteenth: return "m11b13" - case .halfDiminishedFlatThirteenth: return "Øb13" + case .majorTriad: return "" + case .minorTriad: return "m" + case .diminishedTriad: return "º" + case .flatFive: return "b5" + case .augmentedTriad: return "&" + case .suspendedSecondTriad: return "“2" + case .suspendedFourthTriad: return "“4" + case .sixth: return "6" + case .minorSixth: return "m6" + case .halfDiminishedSeventh: return "Ø7" + case .diminishedSeventh: return "º7" + case .dominantSeventh: return "7" + case .dominantSeventhSuspendedFourth: return "7sus4" + case .dominantSeventhSuspendedSecond: return "7sus2" + case .majorSeventh: return "^7" + case .minorSeventh: return "m7" + case .minorMajorSeventh: return "m^7" + case .halfDiminishedNinth: return "Ø9" + case .dominantNinth: return "9" + case .dominantNinthSuspendedFourth: return "9sus4" + case .flatNinth: return "7b9" + case .sharpNinth: return "7#9" + case .majorNinth: return "^9" + case .minorFlatNinth: return "m7b9" + case .minorNinth: return "m9" + case .majorAddNine: return "@9" + case .minorAddNine: return "m@9" + case .sixOverNine: return "%" + case .majorEleventh: return "^11" + case .dominantEleventh: return "11" + case .minorEleventh: return "m11" + case .halfDiminishedEleventh: return "Ø11" + case .majorSeventhFlatFifth: return "^7b5" + case .minorSeventhSharpFifth: return "^7#5" + case .majorNinthSharpEleventh: return "^9#11" + case .dominantFlatFifth: return "7b5" + case .dominantSharpFifth: return "7#5" + case .dominantFlatNinthSharpEleventh: return "7âÅ" + case .dominantSharpNinthSharpEleventh: return "7åÅ" + case .minorSeventhFlatNinthAddEleventh: return "m7b9(@11)" + case .majorThirteenth: return "^13" + case .minorThirteenth: return "m13" + case .minorFlatThirteenthFlatNinth: return "máÆ" + case .majorThirteenthSharpEleventh: return "^13#11" + case .dominantThirteenth: return "13" + case .minorEleventhFlatThirteenth: return "m11b13" + case .halfDiminishedFlatThirteenth: return "Øb13" } } } diff --git a/Sources/Tonic/Interval.swift b/Sources/Tonic/Interval.swift index 6583e40..7e90bd9 100644 --- a/Sources/Tonic/Interval.swift +++ b/Sources/Tonic/Interval.swift @@ -89,79 +89,84 @@ public enum Interval: Int, CaseIterable, Codable { /// Augmented Eleventh case A11 - /// Perfect Thirteenth - case P13 + /// Minor Thirteenth + case m13 - /// Diminished Thirteenth - case d13 + /// Major Thirteenth + case M13 + + /// Augmented Thirteenth + case A13 /// Number of semitones the interval spans public var semitones: Int { switch self { - case .P1: return 0 - case .A1: return 1 - case .m2: return 1 - case .M2: return 2 - case .m3: return 3 - case .M3: return 4 - case .d4: return 4 - case .P4: return 5 - case .A4: return 6 - case .d5: return 6 - case .P5: return 7 - case .A5: return 8 - case .m6: return 8 - case .d7: return 9 - case .M6: return 9 - case .A6: return 10 - case .m7: return 10 - case .M7: return 11 - case .d8: return 11 - case .P8: return 12 - case .A8: return 13 - case .m9: return 13 - case .M9: return 14 - case .A9: return 15 - case .d11: return 16 - case .P11: return 17 - case .A11: return 18 - case .d13: return 20 - case .P13: return 21 + case .P1: return 0 + case .A1: return 1 + case .m2: return 1 + case .M2: return 2 + case .m3: return 3 + case .M3: return 4 + case .d4: return 4 + case .P4: return 5 + case .A4: return 6 + case .d5: return 6 + case .P5: return 7 + case .A5: return 8 + case .m6: return 8 + case .d7: return 9 + case .M6: return 9 + case .A6: return 10 + case .m7: return 10 + case .M7: return 11 + case .d8: return 11 + case .P8: return 12 + case .A8: return 13 + case .m9: return 13 + case .M9: return 14 + case .A9: return 15 + case .d11: return 16 + case .P11: return 17 + case .A11: return 18 + case .m13: return 20 + case .M13: return 21 + case .A13: return 22 } } /// Number of letters the interval spans var degree: Int { switch self { - case .P1: return 1 - case .A1: return 1 - case .m2: return 2 - case .M2: return 2 - case .m3: return 3 - case .M3: return 3 - case .d4: return 4 - case .P4: return 4 - case .A4: return 4 - case .d5: return 5 - case .P5: return 5 - case .A5: return 5 - case .m6: return 6 - case .M6: return 6 - case .A6: return 6 - case .d7: return 7 - case .m7: return 7 - case .M7: return 7 - case .d8: return 8 - case .P8: return 8 - case .A8: return 8 - case .m9: return 9 - case .M9: return 9 - case .A9: return 9 - case .d11: return 11 - case .P11: return 11 - case .A11: return 11 - case .d13: return 13 - case .P13: return 13 + case .P1: return 1 + case .A1: return 1 + case .m2: return 2 + case .M2: return 2 + case .m3: return 3 + case .M3: return 3 + case .d4: return 4 + case .P4: return 4 + case .A4: return 4 + case .d5: return 5 + case .P5: return 5 + case .A5: return 5 + case .m6: return 6 + case .M6: return 6 + case .A6: return 6 + case .d7: return 7 + case .m7: return 7 + case .M7: return 7 + case .d8: return 8 + case .P8: return 8 + case .A8: return 8 + case .m9: return 9 + case .M9: return 9 + case .A9: return 9 + case .d11: return 11 + case .P11: return 11 + case .A11: return 11 + case .m13: return 13 + case .M13: return 13 + case .A13: return 13 } } @@ -195,70 +200,72 @@ extension Interval: CustomStringConvertible { /// Short version of the interval name public var description: String { switch self { - case .P1: return "P1" - case .A1: return "A1" - case .m2: return "m2" - case .M2: return "M2" - case .m3: return "m3" - case .M3: return "M3" - case .d4: return "d4" - case .P4: return "P4" - case .A4: return "A4" - case .d5: return "d5" - case .P5: return "P5" - case .A5: return "A5" - case .m6: return "m6" - case .M6: return "M6" - case .A6: return "A6" - case .d7: return "d7" - case .m7: return "m7" - case .M7: return "M7" - case .d8: return "d8" - case .P8: return "P8" - case .A8: return "A8" - case .m9: return "m9" - case .M9: return "M9" - case .A9: return "A9" - case .d11: return "d11" - case .P11: return "P11" - case .A11: return "A11" - case .d13: return "d13" - case .P13: return "P13" + case .P1: return "P1" + case .A1: return "A1" + case .m2: return "m2" + case .M2: return "M2" + case .m3: return "m3" + case .M3: return "M3" + case .d4: return "d4" + case .P4: return "P4" + case .A4: return "A4" + case .d5: return "d5" + case .P5: return "P5" + case .A5: return "A5" + case .m6: return "m6" + case .M6: return "M6" + case .A6: return "A6" + case .d7: return "d7" + case .m7: return "m7" + case .M7: return "M7" + case .d8: return "d8" + case .P8: return "P8" + case .A8: return "A8" + case .m9: return "m9" + case .M9: return "M9" + case .A9: return "A9" + case .d11: return "d11" + case .P11: return "P11" + case .A11: return "A11" + case .m13: return "m13" + case .M13: return "M13" + case .A13: return "A13" } } /// Longer Description of the Interval name public var longDescription: String { switch self { - case .P1: return "Perfect Unison" - case .A1: return "Augmented Unison" - case .m2: return "Minor Second" - case .M2: return "Major Second" - case .m3: return "Minor Third" - case .M3: return "Major Third" - case .d4: return "Diminished Fourth" - case .P4: return "Perfect Fourth" - case .A4: return "Augmented Fourth" - case .d5: return "Diminished Fifth" - case .P5: return "Perfect Fifth" - case .A5: return "Augmented Fifth" - case .m6: return "Minor Sixth" - case .M6: return "Major Sixth" - case .A6: return "Augmented Sixth" - case .d7: return "Diminished Seventh" - case .m7: return "Minor Seventh" - case .M7: return "Major Seventh" - case .d8: return "Diminished Octave" - case .P8: return "Perfect Octave" - case .A8: return "Augmented Octave" - case .m9: return "Minor Ninth" - case .M9: return "Major Ninth" - case .A9: return "Augmented Ninth" - case .d11: return "Diminished Eleventh" - case .P11: return "Perfect Eleventh" - case .A11: return "Augmented Eleventh" - case .d13: return "Diminished Thirteenth" - case .P13: return "Perfect Thirteenth" + case .P1: return "Perfect Unison" + case .A1: return "Augmented Unison" + case .m2: return "Minor Second" + case .M2: return "Major Second" + case .m3: return "Minor Third" + case .M3: return "Major Third" + case .d4: return "Diminished Fourth" + case .P4: return "Perfect Fourth" + case .A4: return "Augmented Fourth" + case .d5: return "Diminished Fifth" + case .P5: return "Perfect Fifth" + case .A5: return "Augmented Fifth" + case .m6: return "Minor Sixth" + case .M6: return "Major Sixth" + case .A6: return "Augmented Sixth" + case .d7: return "Diminished Seventh" + case .m7: return "Minor Seventh" + case .M7: return "Major Seventh" + case .d8: return "Diminished Octave" + case .P8: return "Perfect Octave" + case .A8: return "Augmented Octave" + case .m9: return "Minor Ninth" + case .M9: return "Major Ninth" + case .A9: return "Augmented Ninth" + case .d11: return "Diminished Eleventh" + case .P11: return "Perfect Eleventh" + case .A11: return "Augmented Eleventh" + case .m13: return "Minor Thirteenth" + case .M13: return "Major Thirteenth" + case .A13: return "Augmented Thirteenth" } } } diff --git a/Tests/TonicTests/ChordTests.swift b/Tests/TonicTests/ChordTests.swift index 3e83bbe..2b2e687 100644 --- a/Tests/TonicTests/ChordTests.swift +++ b/Tests/TonicTests/ChordTests.swift @@ -44,7 +44,7 @@ class ChordTests: XCTestCase { let notes: [Int8] = [60, 65, 67, 70] let pitchSet = PitchSet(pitches: notes.map { Pitch($0) } ) let c7sus4 = Chord.getRankedChords(from: pitchSet) - XCTAssertEqual(c7sus4.map { $0.description }, ["C7sus4"]) + XCTAssertEqual(c7sus4.map { $0.description }, ["C7sus4", "F9sus4"]) } func test7sus2() { diff --git a/Tests/TonicTests/KeyTests.swift b/Tests/TonicTests/KeyTests.swift index 60d5b50..fe9162d 100644 --- a/Tests/TonicTests/KeyTests.swift +++ b/Tests/TonicTests/KeyTests.swift @@ -41,7 +41,7 @@ class KeyTests: XCTestCase { } func testKeyChords() { - XCTAssertEqual(Key.G.chords.count, 42) + XCTAssertEqual(Key.G.chords.count, 49) for triad in Key.G.primaryTriads { XCTAssert(Key.G.chords.contains(triad)) } diff --git a/Tests/TonicTests/ReadMeTests.swift b/Tests/TonicTests/ReadMeTests.swift index 1cf76a1..489d67a 100644 --- a/Tests/TonicTests/ReadMeTests.swift +++ b/Tests/TonicTests/ReadMeTests.swift @@ -16,12 +16,12 @@ final class ReadMeTests: XCTestCase { // What chords are in this key? func testChordsInKey() { - XCTAssertEqual(Key.Cm.chords.count, 42) + XCTAssertEqual(Key.Cm.chords.count, 49) } // What chords in this key contain this note? func testChordsInKeyContainNote() { - XCTAssertEqual(Key.C.chords.filter { $0.noteClasses.contains(.C) }.count, 26) + XCTAssertEqual(Key.C.chords.filter { $0.noteClasses.contains(.C) }.count, 29) } // What notes do these keys have in common?