Documentation ¶
Overview ¶
Package theory implements music theory. There is also support for associating MIDI numbers with music theory. It vaguely corresponds to the MusicXML data structures.
Note that this is inahga's(tm) music theory. My understanding of actual music theory is pretty bad :).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accidental ¶
type Accidental int
const ( Natural Accidental = iota Flat Sharp )
func (Accidental) String ¶
func (a Accidental) String() string
type Key ¶
type Key struct { Major Tone Minor Tone Sig []KeySignature }
func GetKeyByClass ¶
func GetKeyByClass(class Class, adjustment Accidental, mode Mode) (Key, error)
func MustGetKeyByClass ¶
func MustGetKeyByClass(class Class, adjustment Accidental, mode Mode) Key
type KeySignature ¶
type KeySignature struct { Tone TrebleOctave Octave // Helps render the time signature for treble clef BassOctave Octave // Helps render the time signature for bass clef }
func (KeySignature) BassNote ¶
func (s KeySignature) BassNote() Note
BassNote returns a note indicating the octave at which the signature should be placed when rendering bass clef.
func (KeySignature) TrebleNote ¶
func (s KeySignature) TrebleNote() Note
BassNote returns a note indicating the octave at which the signature should be placed when rendering treble clef.
Click to show internal directories.
Click to hide internal directories.