key

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: GPL-3.0 Imports: 3 Imported by: 10

README

Key

GoDoc Coverage

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.

Musical Key on Wikipedia

Credit

Charney Kaye

XJ Music

Documentation

Overview

Key Difference to another Key can be calculated in +/- semitones

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.

https://en.wikipedia.org/wiki/Key_(music)

Credit

Charney Kaye <hi@charneykaye.com> https://charneykaye.com

XJ Music https://xj.io

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) Diff added in v0.0.4

func (this Key) Diff(targetKey Key) int

Diff to another Key calculated in +/- semitones

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