key

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2016 License: MIT Imports: 3 Imported by: 0

README

Key

[GoDoc

A model of a musical key signature.

The key of a piece is a group of pitches, or scale upon which a music composition is created in classical, Western art, and Western pop music.

Author: Charney Kaye

Documentation

Overview

The key of a piece is a group of pitches, or scale upon which a music composition is created in classical, Western art, and Western pop music.

Key has a Mode, e.g. Major or Minor

The relative minor of a major key has the same key signature and starts down a minor third (or equivalently up a major sixth); for example, the relative minor of G major is E minor. Similarly the relative major of a minor key starts up a minor third (or down a major sixth); for example, the relative major of F minor is A♭ major.

Keys are expressed in readable strings, e.g. C major or Ab minor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Root      note.Class
	AdjSymbol note.AdjSymbol
	Mode      Mode
}

Key is a model of a musical key signature

func Of

func Of(name string) Key

Of a particular key, e.g. Of("C minor 7")

func (Key) RelativeMajor added in v0.0.3

func (k Key) RelativeMajor() (rk Key)

func (Key) RelativeMinor added in v0.0.3

func (k Key) RelativeMinor() (rk Key)

func (Key) ToYAML added in v0.0.3

func (k Key) ToYAML() string

type Mode

type Mode int

Mode is the mode of a key, e.g. Major or Minor

const (
	Nil Mode = iota
	Major
	Minor
)

func (Mode) String added in v0.0.3

func (of Mode) String() string

String of the Mode, e.g. "Major" or "Minor"

Jump to

Keyboard shortcuts

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