note

package
v0.0.1 Latest Latest
Warning

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

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

README

Note

GoDoc Coverage

An opinionated model of a musical note.

A Note is used to represent the relative duration and pitch of a sound.

Author: Charney Kaye

Documentation

Overview

In music, a pitch class is a set of all pitches that are a whole number of octaves apart, e.g., the pitch class C consists of the Cs in all octaves.

A Note is used to represent the relative duration and pitch of a sound.

A perfect octave is the interval between one musical pitch and another with half or double its frequency.

Note can be the Root of a Chord, Key or Scale.

Index

Constants

View Source
const (
	NONE = Class("-")
	C    = Class("C")
	CS   = Class("C#")
	D    = Class("D")
	DS   = Class("D#")
	E    = Class("E")
	F    = Class("F")
	FS   = Class("F#")
	G    = Class("G")
	GS   = Class("G#")
	A    = Class("A")
	AS   = Class("A#")
	B    = Class("B")
)

Variables

This section is empty.

Functions

func NameOf

func NameOf(text string) (Class, Octave)

NameOf a note will return its Class and Octave

Types

type Class

type Class string

Class of pitch for a note (across all octaves)

func ClassNamed

func ClassNamed(text string) Class

ClassNamed returns a pitch Class

func RootAndRemaining

func RootAndRemaining(name string) (root Class, nameWithoutRoot string)

Parse all forms using Regexp's against a string

func (Class) Step

func (from Class) Step(inc int) (Class, Octave)

Step from a class to another class, +/- semitones, +/- octave

type Note

type Note struct {
	Performer string  // name of performer (for reference)
	Position  float64 // >0, # of beats
	Duration  float64 // >0, # of beats
	Class     Class   // Class of pitch
	Octave    Octave  // Octave #
	Code      string  // custom, directly from music
}

Note models a musical note

func Named

func Named(text string) (n *Note)

Named note returns a Note model

func OfClass

func OfClass(class Class) (n *Note)

OfClass pitch returns a Note model

func (*Note) ShiftTime

func (from *Note) ShiftTime(t float64) *Note

ShiftTime to copy the note to another position in time.

type Octave

type Octave int

Octave models a musical octave

func OctaveOf

func OctaveOf(text string) Octave

Octave of text returns a new Octave

Jump to

Keyboard shortcuts

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