AudioKit / Tonic

Swift library for music theory
https://www.audiokit.io/Tonic/
MIT License
154 stars 21 forks source link

No sus2 Chordtype available #17

Closed SebastianBoldt closed 10 months ago

SebastianBoldt commented 10 months ago

Description

Currently the Chordtype-Type only provides a suspendedTriad which technically is a sus4 chord because it consists of the following intervals [.P4, .P5]. Wouldn't it be nice to also have a sus2 Type? Is there any specific reason this is missing 🤔 ?

Proposed Solution

Splitting the suspendedTriad into suspendedSecondTriad and suspendedFourthTriad

case .suspendedFourth return [.P4, .P5]
case .suspendedSecond return [.M2, P5]

Describe Alternatives You've Considered

Wrapping my own Chordtype around the Tonic.Chordtype

aure commented 10 months ago

Hi Sebastian,

Here's the difficullty with sus2 and sus4 chords. If you play the notes A, D, E, our library will identify that as a A sus4 chord, but if the sus2 case you suggests adding were added, those notes could be classified as a D sus2 chord. This ambiguity is solved by music transcribers by listening for what is the most prominent note, or the bass note, and assuming that is the root, or by looking at the context of the song. As an example, a guitarist lifting his finger off high the high note of a D chord is making a D sus2 chord, not jumping to an A sus4.

So for us, a proposed solution would have to entail some sort of logic around how we name chords with teh same spelling based on other characteristics, like perhaps in that case finding the lowest note that could be the root and deciding to name the chord off of that note. But, that feels very subjective to me, so we have not implemented anything like that.

Aure

Matt54 commented 10 months ago

Screenshot 2024-01-22 at 1 47 29 PM @aure I thought these "Potential Chords" were added to address that issue in the demo project

aure commented 10 months ago

I don't even recall the notion of potential chords, will have to refresh my memory.

aure commented 10 months ago

Thanks @SebastianBoldt for bringing up this issue, and thanks @Matt54 for reminding me we had given it some thought.

aure commented 10 months ago

Fixed in 1.1 https://github.com/AudioKit/Tonic/releases/tag/1.1.0