Skip to content

Commit

Permalink
Fix guess bug, and add crunchy.
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchax committed Dec 26, 2022
1 parent a7d7e10 commit cb78a51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
kord = "0.1"
kord = "*" #choose a version
```

### Examples
Expand Down
6 changes: 3 additions & 3 deletions src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum Command {
#[arg(short, long, default_value_t = 0.1f32)]
fade_in: f32,

/// Sets whether or not the chord should be played "crunchy"
/// Sets whether or not the chord should be played "crunchy" (i.e., all within one octave of the root)
#[arg(short, long, default_value_t = false)]
crunchy: bool,
},
Expand Down Expand Up @@ -83,10 +83,10 @@ fn start(args: Args) -> Void {
},
Some(Command::Guess { notes }) => {
// Parse the notes.
let notes = notes.into_iter().map(|n| Note::parse(&n)).collect::<Result<Vec<_>, _>>()?;
let notes = dbg!(notes.into_iter().map(|n| Note::parse(&n)).collect::<Result<Vec<_>, _>>()?);

// Get the chord from the notes.
let candidates = Chord::from_notes(&notes)?;
let candidates = dbg!(Chord::from_notes(&notes)?);

for candidate in candidates {
describe(&candidate);
Expand Down
1 change: 1 addition & 0 deletions src/chord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,5 +1210,6 @@ mod tests {
#[test]
fn test_guess() {
assert_eq!(Chord::from_notes(&[EThree, C, EFlat, FSharp, ASharp, DFive]).unwrap().first().unwrap().chord(), Chord::parse("Cm9b5/E").unwrap().chord());
assert_eq!(Chord::from_notes(&[C, E, G]).unwrap().first().unwrap().chord(), Chord::parse("C").unwrap().chord());
}
}
3 changes: 2 additions & 1 deletion src/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ static KNOWN_MODIFIER_SETS: Lazy<[Vec<Modifier>; 35]> = Lazy::new(|| [
vec![Modifier::Sharp9, Modifier::Dominant(Degree::Thirteen)],
]);

static ONE_OFF_MODIFIER_SETS: Lazy<[Vec<Modifier>; 5]> = Lazy::new(|| [
static ONE_OFF_MODIFIER_SETS: Lazy<[Vec<Modifier>; 6]> = Lazy::new(|| [
vec![],
vec![Modifier::Sharp11],
vec![Modifier::Augmented5],
vec![Modifier::Flat5],
Expand Down

0 comments on commit cb78a51

Please sign in to comment.