-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(harmony): make
Chord
implement extracted Chordable
mixin met…
…hods (#175) * feat(harmony): make `Chord` implement extracted `Chordable` mixin methods * docs(chord): add missing type parameter to `Chord` reference * docs(scale): add missing type parameter in `Scale` references * docs: add missing type parameters in references * test(chord): add missing test cases for `add13` and `add` methods * chore(settings): add lowercase `chordable` cSpell word
- Loading branch information
1 parent
2534c9f
commit 27e371c
Showing
8 changed files
with
373 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
part of '../music_notes.dart'; | ||
|
||
mixin Chordable<T> { | ||
/// Returns a new [T] with an [ImperfectQuality.augmented] root triad. | ||
T get augmented; | ||
|
||
/// Returns a new [T] with an [ImperfectQuality.major] root triad. | ||
T get major; | ||
|
||
/// Returns a new [T] with an [ImperfectQuality.minor] root triad. | ||
T get minor; | ||
|
||
/// Returns a new [T] with an [ImperfectQuality.diminished] root triad. | ||
T get diminished; | ||
|
||
/// Returns a new [T] with a suspended [Interval.majorSecond]. | ||
T sus2() => add(Interval.majorSecond, replaceSizes: const [3, 4]); | ||
|
||
/// Returns a new [T] with a suspended [Interval.perfectFourth]. | ||
T sus4() => add(Interval.perfectFourth, replaceSizes: const [2, 3]); | ||
|
||
/// Returns a new [T] adding a [quality] 6th. | ||
T add6([ImperfectQuality quality = ImperfectQuality.major]) => | ||
add(Interval.imperfect(6, quality)); | ||
|
||
/// Returns a new [T] adding a [quality] 7th. | ||
T add7([ImperfectQuality quality = ImperfectQuality.minor]) => | ||
add(Interval.imperfect(7, quality)); | ||
|
||
/// Returns a new [T] adding a [quality] 9th. | ||
T add9([ImperfectQuality quality = ImperfectQuality.major]) => | ||
add(Interval.imperfect(9, quality)); | ||
|
||
/// Returns a new [T] adding an [quality] 11th. | ||
T add11([PerfectQuality quality = PerfectQuality.perfect]) => | ||
add(Interval.perfect(11, quality)); | ||
|
||
/// Returns a new [T] adding a [quality] 13th. | ||
T add13([ImperfectQuality quality = ImperfectQuality.major]) => | ||
add(Interval.imperfect(13, quality)); | ||
|
||
/// Returns a new [T] adding [interval]. | ||
T add(Interval interval, {List<int>? replaceSizes}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.