cemolcay / MusicTheory

Universal music theory library for iOS, iPadOS, macOS, tvOS and watchOS in Swift
MIT License
438 stars 50 forks source link

how to create a suspended chord (sus2 / sus4) - ChordType initializer forces to use a third #51

Open ayaphi opened 1 year ago

ayaphi commented 1 year ago

Hi,

I try to create simple sus2 and sus4 chords, but I cannot find a way to do so - I am always getting the third along, as the initializer enforces a ChordThirdType parameter (it's not optional as ChordSixthType e.g)

let sus2 = ChordType(
    third: .major,
    fifth: .perfect,
    suspended: .sus2)

print(sus2.intervals)   // [Perfect 1st, Major 3rd, Major 2nd, Perfect 5th]
let csus2 = Chord(
  type: sus2,
  key: Key(type: .c))

csus2.notation
print(csus2.keys)  // [C, E, D, G]
print(csus2.description)   // C Major  Suspended 2nd

Any ideas? Thanks.

SebastianBoldt commented 7 months ago

Same Issue on my side. Any Ideas how to solve this @cemolcay ?

Even if you initialize with the correct Intervals you get the wrong representation:

.init(intervals: [.P4, .P5])
SebastianBoldt commented 7 months ago

Switched to a different Library. Seems to be inactive.