note

package
v0.0.0-...-0ba011f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2014 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Overview

Provides Musical Note functions so that we can transpose or find a range.

Index

Examples

Constants

View Source
const (
	C      = Note(0)
	CSharp = Note(1)
	D      = Note(2)
	DSharp = Note(3)
	E      = Note(4)
	F      = Note(5)
	FSharp = Note(6)
	G      = Note(7)
	GSharp = Note(8)
	A      = Note(9)
	ASharp = Note(10)
	B      = Note(11)
)

Variables

View Source
var (
	InternationalDictionary = Dictionary{"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}
	FrenchDictionary        = Dictionary{"Do", "Do#", "Ré", "Ré#", "Mi", "Fa", "Fa#", "Sol", "Sol#", "La", "La#", "Si"}
	PreferredDictionary     = InternationalDictionary
	Dictionaries            = []Dictionary{
		InternationalDictionary,
		FrenchDictionary,
	}
)
View Source
var (
	Chromatic = Range{Name: "Chromatic", Intervals: []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}
	Major     = Range{Name: "Major", Intervals: []int{2, 2, 1, 2, 2, 2, 1}}
	Minor     = Range{Name: "Minor", Intervals: []int{2, 1, 2, 2, 1, 2, 2}}
)

Functions

This section is empty.

Types

type Dictionary

type Dictionary [noteCount]string

type Note

type Note int
Example
PreferredDictionary = InternationalDictionary
fmt.Println(A)
fmt.Println(Major.Notes(C))
fmt.Println(Minor.Notes(A))
Output:

A
[C D E F G A B]
[A B C D E F G]

func ParseNote

func ParseNote(note string) Note

func (Note) Interval

func (note Note) Interval(interval int) Note

func (Note) String

func (note Note) String() string

func (Note) StringNLS

func (note Note) StringNLS(dictionary Dictionary) string

type Range

type Range struct {
	Name      string
	Intervals []int
}

func (Range) Degree

func (r Range) Degree(start Note, degree int) Note

func (Range) Notes

func (r Range) Notes(start Note) []Note

Jump to

Keyboard shortcuts

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