Skip to content

Commit

Permalink
Add short first doc paragraph (#153)
Browse files Browse the repository at this point in the history
* Add short first doc paragraph

* Fix some more first doc paragraphs
  • Loading branch information
noeddl authored Oct 18, 2024
1 parent 4929723 commit c93b46f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/fret_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{FretID, STRING_COUNT};
pub struct ParseFretPatternError;

/// A pattern of frets to press down for playing a chord.
///
/// Each index of the array corresponds to a ukulele string.
#[derive(Debug, Copy, Clone)]
pub struct FretPattern {
Expand Down
1 change: 1 addition & 0 deletions src/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct ParseIntervalError {
}

/// An interval is the difference between two notes.
///
/// https://en.wikipedia.org/wiki/Interval_(music)
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Interval {
Expand Down
1 change: 1 addition & 0 deletions src/staff_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::StaffSteps;
const STAFF_POSITION_COUNT: StaffSteps = 7;

/// The vertical position of the notehead on the staff (on a line or in a space).
///
/// We use the staff position of an enharmonic note to decide whether it is sharp
/// or flat.
///
Expand Down
10 changes: 6 additions & 4 deletions src/voicing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ use crate::{
FINGER_COUNT, STRING_COUNT,
};

/// A chord voicing.
///
/// The voicing of a chord describes the order of the individual notes within
/// the chord. The same chord can be voiced in different ways, i.e. there are
/// several ways to play the same chord on the ukulele.
/// https://en.wikipedia.org/wiki/Voicing_(music)
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Voicing {
uke_strings: [UkeString; STRING_COUNT],
}

/// The voicing of a chord describes the order of the individual notes within
/// the chord. The same chord can be voiced in different ways, i.e. there are
/// several ways to play the same chord on the ukulele.
/// https://en.wikipedia.org/wiki/Voicing_(music)
impl Voicing {
// Create a Voicing instance from a set of frets and a tuning.
// As there is no information about a certain chord for which
Expand Down
4 changes: 3 additions & 1 deletion src/voicing_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use crate::{Chord, ChordSequence, Distance, Semitones, Voicing, VoicingConfig};

const MAX_DIST: Semitones = 10;

/// A graph whose nodes represent chord voicings and whose edges
/// A graph of voicings to find the optimal voice leading.
///
/// The nodes of the graph represent chord voicings and its edges
/// are weighted by the distances between the voicings. It is used
/// to find the (by some definition) optimal voice leading for
/// a given sequence of chords.
Expand Down

0 comments on commit c93b46f

Please sign in to comment.