|
1 | 1 | use crate::chord::ChordQuality; |
| 2 | +use crate::chord::FretID; |
| 3 | +use crate::chord::FretPattern; |
2 | 4 | use crate::note::Interval; |
3 | 5 | use crate::note::Note; |
4 | | -use crate::FretPattern; |
5 | | -use crate::Frets; |
6 | | -use crate::IntervalPattern; |
| 6 | +use crate::note::Semitones; |
7 | 7 | use crate::STRING_COUNT; |
8 | 8 | use std::str::FromStr; |
9 | 9 |
|
| 10 | +type IntervalPattern = [Interval; STRING_COUNT]; |
| 11 | + |
10 | 12 | /// A chord shape is a configuration of frets to be pressed to play a |
11 | 13 | /// chord with a certain chord quality. The shape can be moved along |
12 | 14 | /// the fretboard to derive several chords. |
@@ -38,7 +40,7 @@ impl ChordShape { |
38 | 40 |
|
39 | 41 | /// Apply the chord shape while moving it `n` frets forward on the fretboard. |
40 | 42 | /// Return the resulting fret pattern. |
41 | | - fn apply(self, n: Frets) -> (FretPattern, IntervalPattern) { |
| 43 | + fn apply(self, n: Semitones) -> (FretPattern, IntervalPattern) { |
42 | 44 | let mut frets = self.frets; |
43 | 45 |
|
44 | 46 | for f in &mut frets[..] { |
@@ -78,7 +80,7 @@ impl ChordShapeSet { |
78 | 80 | } |
79 | 81 |
|
80 | 82 | /// Return a fret pattern to play `chord` starting from fret number `min_fret`. |
81 | | - pub fn get_config(self, root: Note, min_fret: Frets) -> (FretPattern, IntervalPattern) { |
| 83 | + pub fn get_config(self, root: Note, min_fret: FretID) -> (FretPattern, IntervalPattern) { |
82 | 84 | let (chord_shape, diff) = self |
83 | 85 | .chord_shapes |
84 | 86 | .into_iter() |
|
0 commit comments