cemolcay / MusicTheory

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

Fully Diminished Seventh not possible with current Chord infrastructure #32

Closed maksutovic closed 5 years ago

maksutovic commented 5 years ago

Hi Cem!

Please excuse this if I am not understanding correctly, however to what I can see now, to notate a fully (or doubly) diminished Seventh chord is not currently possible.

This is due to the fact that in ChordSeventhType, there are only two available enums: .major and .dominant

From a purely musical theory standard, there needs to be three types of sevenths: .major, .dominant, and .diminished.

Here is my logic to how you build each kind of (standard) seventh chords (in pseudo code):

Major Seventh:
ChordThirdType = .major
ChordFifthType = .perfect
ChordSeventhType = .major

Dom Seventh:
ChordThirdType = .major
ChordFifthType = .perfect
ChordSeventhType = .dominant

Minor Seventh:
ChordThirdType = .minor
ChordFifthType = .perfect
ChordSeventhType = .dominant

Half Diminished Seventh:
ChordThirdType = .minor
ChordFifthType = .diminished
ChordSeventhType = .dominant

Fully (also known as "Doubly") Diminished Seventh:
ChordThirdType = .minor
ChordFifthType = .diminished
ChordSeventhType = [NOT AVAILABLE] (should be = .diminished

Another way to think of this is from a note perspective, let's use C major as an example: a seventh can be natural (which results in a major, or augmented major seven chord) or "B" natural. For a dominant 7th, we flatten the B natural to a Bb, now this flatten Bb is used for Dominant, Minor, and half diminished C 7 chords. Now, to get a fully diminished C 7 chord, we would need to flatten the Bb one more time, resulting in a B double flat.

CMaj7 = B natural C7 = Bb Cmin7 = Bb Chalfdim7 = Bb Cfulldim7 = Bbb

I really want to do a pull request for this as I think it's an easy fix, however I'm literally a day before submitting an app and I don't think I'll be able to get the pull request and testing done in time. If there are any suggestions you can think with the existing library, I would be so appreciative, and I promise that after NAMM I will do a pull request and add this if you agree with the implementation.

Let me know if this is doesn't make sense or I somehow missed something in composing fully diminished 7 chords. Thanks again so much!

cemolcay commented 5 years ago

Hi Max,

Thanks for the heads up. I quickly added the diminished case to the ChordSeventhType enum. Does this look correct to you?

screen shot 2019-01-21 at 02 06 09
maksutovic commented 5 years ago

Wow!

That was fast! Yes correct but minor fix that in this case the third needs to be minor, but otherwise that looks perfect, thank you!!

Sent from my iPhone

On Jan 20, 2019, at 16:08, Cem Olcay notifications@github.com wrote:

Hi Max,

Thanks for the heads up. I quickly added the diminished case to the ChordSeventhType enum. Does this look correct to you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

maksutovic commented 5 years ago

Sorry for the late response, moving fast xD -- and at least back to music school, we should call this "C Fully Diminished 7th" or "C Doubly Diminished 7th"

cemolcay commented 5 years ago

Fixing the descriptive naming will be hard. I'm literally building the chord names by putting together their ChordParts. I'll think about a smarter system later for that :)

maksutovic commented 5 years ago

Don’t worry, my friend and I want to contribute and we’ll help, we have some super cool additions to the library we’ll do a pull request after NAMM and see what you think!

Sent from my iPhone

On Jan 24, 2019, at 00:22, Cem Olcay notifications@github.com wrote:

Fixing the descriptive naming will be hard. I'm literally building the chord names by putting together their ChordParts. I'll think about a smarter system later for that :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.