Documentation
¶
Index ¶
Constants ¶
View Source
const ( UnknownQuality = Quality(iota) Major Minor Diminished Augmented )
Variables ¶
View Source
var ( StandardTuningSteps = TuningSteps{ // contains filtered or unexported fields } DropTuningSteps = TuningSteps{ // contains filtered or unexported fields } )
View Source
var ( TuningEStandard = Tuning{Tonic: E.TransposeOctave(2), Steps: StandardTuningSteps} TuningDStandard = Tuning{Tonic: D.TransposeOctave(2), Steps: StandardTuningSteps} TuningDropD = Tuning{Tonic: D.TransposeOctave(2), Steps: DropTuningSteps} TuningDropC = Tuning{Tonic: C.TransposeOctave(2), Steps: DropTuningSteps} )
View Source
var ( // Basic Scales MajorScaleDegrees = ScaleDegrees{ // contains filtered or unexported fields } MinorScaleDegrees = MajorScaleDegrees.Shift("minor", 6) // Major Modes IonianScaleDegrees = MajorScaleDegrees.Shift("ionian", 1) DorianScaleDegrees = IonianScaleDegrees.Shift("dorian", 2) PhrygianScaleDegrees = IonianScaleDegrees.Shift("phrygian", 3) LydianScaleDegrees = IonianScaleDegrees.Shift("lydian", 4) MixolydianScaleDegrees = IonianScaleDegrees.Shift("mixolydian", 5) AeolianScaleDegrees = IonianScaleDegrees.Shift("aeolian", 6) LocrianScaleDegrees = IonianScaleDegrees.Shift("locrian", 7) // Blues Scales HexatonicBluesScaleDegrees = ScaleDegrees{ // contains filtered or unexported fields } HeptatonicBluesScaleDegrees = ScaleDegrees{ // contains filtered or unexported fields } NonatonicBluesScaleDegrees = ScaleDegrees{ // contains filtered or unexported fields } // Japanese Scales HirajōshiScaleDegrees = ScaleDegrees{ // contains filtered or unexported fields } )
Functions ¶
func AbsI ¶
func AbsI[A constraints.Integer](value A) A
func ClampI ¶
func ClampI[A constraints.Integer](value, min, max A) A
func ReverseCopy ¶
func ReverseCopy[T any](slice []T) []T
Types ¶
type Accidental ¶
type Accidental int
const ( Natural Accidental = 0 Flat Accidental = -1 Sharp Accidental = 1 )
func (Accidental) String ¶
func (a Accidental) String() string
type Note ¶
type Note struct {
// contains filtered or unexported fields
}
var ( C Note = Note{/* contains filtered or unexported fields */} D Note = Note{/* contains filtered or unexported fields */} E Note = Note{/* contains filtered or unexported fields */} F Note = Note{/* contains filtered or unexported fields */} G Note = Note{/* contains filtered or unexported fields */} A Note = Note{/* contains filtered or unexported fields */} B Note = Note{/* contains filtered or unexported fields */} )
func NoteFromValue ¶
func (Note) Accidental ¶
func (n Note) Accidental(a Accidental) Note
func (Note) TransposeOctave ¶
func (Note) TransposeSemitone ¶
type Scale ¶
type Scale struct { Tonic Note Degrees ScaleDegrees }
type ScaleDegrees ¶
type ScaleDegrees struct {
// contains filtered or unexported fields
}
1 = a semitone
func (*ScaleDegrees) Shift ¶
func (s *ScaleDegrees) Shift(name string, offset int) ScaleDegrees
type Tuning ¶
type Tuning struct { Tonic Note Steps TuningSteps }
type TuningSteps ¶
type TuningSteps struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.