scale

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

Scale

GoDoc Coverage

A model of a musical scale.

In music theory, a scale is any set of musical notes ordered by fundamental frequency or pitch.

Musical Scale on Wikipedia

A scale ordered by increasing pitch is an ascending scale, and a scale ordered by decreasing pitch is a descending scale. Some scales contain different pitches when ascending than when descending. For example, the Melodic minor scale.

Credit

Charney Kaye

XJ Music

Documentation

Overview

A Scale Interval is how the members of the scale 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 scale parsing rules.

Scales have different Modes, such as Triad, Seventh, Extended, Added/Omitted, Specific or General.

In music theory, a scale is any set of musical notes ordered by fundamental frequency or pitch.

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

A scale ordered by increasing pitch is an ascending scale, and a scale ordered by decreasing pitch is a descending scale. Some scales contain different pitches when ascending than when descending. For example, the Melodic minor scale.

Credit

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

XJ Music https://xj.io

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interval

type Interval int

Interval within a scale, 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 = 16
)

type List

type List []string
var ScaleModeList List

func (List) ToYAML

func (l List) ToYAML() string

ToYAML any List to an array of strings

type Mode

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

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

func (*Mode) MatchString

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

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

type ModeIntervals

type ModeIntervals []int

ModeAdd maps an interval-from-scale-root to a +/1 semitone adjustment

type ModeOmit

type ModeOmit []Interval

ModeOmit maps an interval-from-scale-root to omit

type Scale

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

Scale in a particular key

func Of

func Of(name string) Scale

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

func (*Scale) Notes

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

Notes to obtain the notes from the Scale

func (Scale) ToYAML

func (c Scale) ToYAML() string

Jump to

Keyboard shortcuts

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