Fretboards.PITCH_NAMESConstant

Pitch names for printing.

We always print sharp notes, eg C♯ instead of D♭.

Fretboards.DrawingCharsType
struct DrawingChars

Characters for drawing a Fretboard.

Fields

  • string_char

    Strings between frets.

  • fret_char

    Fret-string crossings.

  • nut_char

    Nut (fret 0).

Fretboards.FretboardMethod
Fretboard(tuning, frets)

Create a fretboard which can be annotated with strings, either by as an AbstractMatrix, or using annotate_matches! (recommended).

Fretboards.PitchType

A pitch (pitch). It is recommended that the pitch"..." constructor is used, see parse_pitch.

+ and - with integers change the pitch by a given number of semitones.

Fretboards.:≂Method
≂(pitch1, pitch2)

Test if two pitchs octave equivalent (ie are separated by an integer number of octaves), ie are in the same pitch class.

Fretboards._print_ascii_all_annotationsMethod
_print_ascii_all_annotations(io, drawing_chars, fret_spacing, open_pitch, all_annotations)

Print ASCII for all annotations for a string.

Arguments

  • io: output
  • drawing_chars: character set for drawing
  • fret_spacing: the number of characters between frets
  • open_pitch: pitch of the open string (fret 0)
  • all_annotations: a vector of Vector{Annotation}s
Fretboards._print_ascii_fret_annotationsMethod
_print_ascii_fret_annotations(io, string_char, fret_spacing, annotations)

Print ASCII for a single fret annotation, for the space between frets.

Arguments

  • io: output
  • string_char: character for depicting strings, eg -,
  • fret_spacing: the number of characters between frets
  • annotations: a vector of Annotations
Fretboards._print_ascii_fret_numbersMethod
_print_ascii_fret_numbers(io, fret_spacing, frets)

Print fret numbers.

Arguments

  • io: output
  • fret_spacing: the number of characters between frets
  • frets: the number of frets
Fretboards.annotate_matches!Method
annotate_matches!(predicate, annotation, fretboard; kwargs...)

Shorthand for inserting the same annotation when predicate returns true. See the other method of annotate_matches! for details.

Example

julia> using Fretboards, Fretboards.Intervals

julia> fb = Fretboard(STANDARD_TUNING, 7);

julia> let root = pitch"C"
           for (mark, semitones) in [("1", 0), ("3", M3), ("5", P5)]
               annotate_matches!(x -> x.pitch ≂ root + semitones, Annotation(mark), fb)
           end
       end

julia> fb
          0      1      2      3      4      5      6      7
E4       3|------|------|-----5|------|------|------|------|
B3        |-----1|------|------|------|-----3|------|------|
G3       5|------|------|------|------|-----1|------|------|
D3        |------|-----3|------|------|-----5|------|------|
A2        |------|------|-----1|------|------|------|-----3|
E2       3|------|------|-----5|------|------|------|------|
Fretboards.annotate_matches!Method
annotate_matches!(f, fretboard; skip_duplicates)

For each fret on each string, call f with a value that has the following properties:

  • string: the string number, from highest pitch (1), eg 6 for pitch"E2"
  • open_pitch: the pitch of the open string (eg pitch"E2")
  • pitch: pitch of the fret (eg `pitch"G2")
  • fret: fret number, eg 3.

f should return an Annotation or nothing.

Fretboards.parse_pitchMethod
parse_pitch(str)

Parse a pitch in scientific pitch notation, composed of

  • an upper- or lowecase letter A-G for the pitch

  • an optional accidental b, # (plain ascii), or , (Unicode accidentals),

  • an optional octave number (0 if omitted, can be negative)

Example arguments: "C#2", "D♭-2" `.

Fretboards.print_asciiFunction
print_ascii(io, fretboard)
print_ascii(io, fretboard, drawing_chars)
print_ascii(io, fretboard, drawing_chars, min_fret_spacing)

Print fretboard with the specified drawing_chars character set.