Skip to content

Commit

Permalink
use Note::transpose instead of saturating u8 values when create note …
Browse files Browse the repository at this point in the history
…chords
  • Loading branch information
emuell committed Jun 14, 2024
1 parent 685ebe4 commit 4734bcf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/bindings/unwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,9 @@ pub(crate) fn chord_events_from_mode(
Ok(chord
.intervals()
.iter()
.copied()
.map(|i| {
Some(NoteEvent {
note: Note::from((chord.note() as u8).saturating_add(i)),
note: chord.note().transposed(*i as i32),
..note_event.clone()
})
})
Expand All @@ -671,10 +670,9 @@ pub(crate) fn chord_events_from_intervals(
Ok(chord
.intervals()
.iter()
.copied()
.map(|i| {
Some(NoteEvent {
note: Note::from((chord.note() as u8).saturating_add(i)),
note: chord.note().transposed(*i as i32),
..note_event.clone()
})
})
Expand Down

0 comments on commit 4734bcf

Please sign in to comment.