chord

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: 12

README

Chord

GoDoc Coverage

A model of a musical chord.

A chord, in music, is any harmonic set of three or more notes that is heard as if sounding simultaneously.

Musical Chord on Wikipedia

Credit

Charney Kaye

XJ Music

Documentation

Overview

A chord, in music, is any harmonic set of three or more notes that is heard as if sounding simultaneously.

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

Credit

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

XJ Music https://xj.io

Chords have different Forms, such as Triad, Seventh, Extended, Added/Omitted, Specific or General.

Chords have different Functions, such as Diatonic, Altered or Other.

A Chord Interval is how the members of the chord are counted, from 1 (the "root") to e.g. 3 (the "third") or 5 (the "fifth")

It's possible to export a list of all known chord parsing rules.

Chords are expressed in readable strings, e.g. CMb5b7 or Cm679-5

Chords have different Techniques, such as Block, Chordioid, Guitar, Open, Power or Slash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chord

type Chord struct {
	Root      note.Class
	AdjSymbol note.AdjSymbol
	Tones     map[Interval]note.Class
}

Chord in a particular key

func Of

func Of(name string) Chord

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

func (*Chord) Notes

func (this *Chord) Notes() (notes []*note.Note)

Notes to obtain the notes from the Chord

func (Chord) ToYAML

func (c Chord) ToYAML() string

func (Chord) Transpose added in v0.0.4

func (this Chord) Transpose(semitones int) Chord

Transpose a chord +/- semitones

type Form

type Form struct {
	Name string
	// contains filtered or unexported fields
}

Form is identified by positive/negative regular expressions, and then adds/removes pitch classes by interval from the root of the chord.

func (*Form) MatchString

func (this *Form) MatchString(s string) bool

MatchString processes the positive/negative regular expressions to determine if this form matches a string.

type FormAdd

type FormAdd map[Interval]int

FormAdd maps an interval-from-chord-root to a +/1 semitone adjustment

type FormOmit

type FormOmit []Interval

FormOmit maps an interval-from-chord-root to omit

type Interval

type Interval int

Interval within a chord, counted from 1 (the "root" to e.g. 3 (the "third") or 5 (the "fifth") up to 16.

const (
	I1  Interval = 1
	I2  Interval = 2
	I3  Interval = 3
	I4  Interval = 4
	I5  Interval = 5
	I6  Interval = 6
	I7  Interval = 7
	I8  Interval = 8
	I9  Interval = 9
	I10 Interval = 10
	I11 Interval = 11
	I12 Interval = 12
	I13 Interval = 13
	I14 Interval = 14
	I15 Interval = 15
	I16 Interval = 15
)

type List added in v0.0.3

type List []string
var ChordFormList List

func (List) ToYAML added in v0.0.3

func (l List) ToYAML() string

ToYAML any List to an array of strings

Jump to

Keyboard shortcuts

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