fretboard

package
v0.0.0-...-1fd1ca1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleMinor string = "minor"
	ScaleMajor        = "major"
)

Variables

View Source
var (
	TuningStandard = "E A D G B E"
)

Functions

This section is empty.

Types

type Chord

type Chord struct {
	Name string
	Root Note
	// contains filtered or unexported fields
}

func NewChord

func NewChord(rootNote Note, intervals ...uint) Chord

func ParseChord

func ParseChord(name string) (Chord, error)

func (Chord) Contains

func (c Chord) Contains(n Note) bool

type Fret

type Fret struct {
	Number      uint
	Note        Note
	Highlighted bool
	Root        bool
}

type Fretboard

type Fretboard struct {
	Tuning  Tuning
	Strings uint
	Frets   uint
	Scale   Scale
	Chord   Chord
	// contains filtered or unexported fields
}

func New

func New(options Options) (*Fretboard, error)

func (*Fretboard) Fret

func (f *Fretboard) Fret(string, fret uint) (Fret, error)

func (*Fretboard) HighlightChord

func (f *Fretboard) HighlightChord(c Chord)

func (*Fretboard) HighlightScale

func (f *Fretboard) HighlightScale(s Scale)

func (*Fretboard) String

func (f *Fretboard) String() string

type Note

type Note struct {
	// contains filtered or unexported fields
}

func NewNote

func NewNote(value string) (Note, error)

func (Note) Add

func (n Note) Add(semitones uint) Note

func (Note) Equals

func (n Note) Equals(other Note) bool

func (Note) IntervalTo

func (n Note) IntervalTo(other Note) string

func (Note) String

func (n Note) String() string

type Options

type Options struct {
	Tuning Tuning
	Frets  uint
}

type Scale

type Scale struct {
	Root Note
	// contains filtered or unexported fields
}

func NewScale

func NewScale(rootNote string, scaleType string) (Scale, error)

func (Scale) Chords

func (s Scale) Chords() []Chord

func (Scale) Contains

func (s Scale) Contains(note Note) bool

func (Scale) Name

func (s Scale) Name() string

type Tuning

type Tuning struct {
	// contains filtered or unexported fields
}

func NewTuning

func NewTuning(notes string) (Tuning, error)

func (Tuning) IsZero

func (t Tuning) IsZero() bool

func (Tuning) Notes

func (t Tuning) Notes() []Note

func (Tuning) Strings

func (t Tuning) Strings() uint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL