gen

package
v0.0.0-...-fec55e7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandNotes

func ExpandNotes(seq []Note, hands int) [][]Note

Explode a sequence of notes into "chords" of those notes that play each as a single note. The number of hands sets how many hands should be playing the pattern.

func GenScale

func GenScale(tx timelearn.Populator, prac *practice, hands, base string) error

func GenScales

func GenScales(tl *timelearn.T) error

Replace the scales in the given problem set with newly generated ones. In order for the results to be meaningful, we rely on the "INTEGER PRIMARY KEY" field in SQLITE3 to always be 1 larger than the current largest value (starting at 1 for an empty table).

func MakeScale

func MakeScale(base string, scale *Scale) ([][]Note, error)

Generate a scale starting at a given base note, using the given intervals (which should cover exactly an octave), and the given pattern ({0} would just be the scale up and down, {0,2} would be a 3-up pattern, for example).

Types

type Note

type Note int

func NoteOfText

func NoteOfText(text string) (Note, error)

Decode a textual representation of a note. Notes are a letter possibly followed by a sharp or flat sign (in ascii or Unicode). The resulting note will be between middle C and the C above that (for a B#). Returns an error if the not is not valid.

func (Note) String

func (n Note) String() string

Convert a midi note value into a name/octave, with C0 being the lowest midi note.

type Scale

type Scale struct {
	Intervals string // Intervals between the notes, must describe 1 octave.
	Pattern   []int  // The pattern for arps.
	Octaves   int    // How many octaves for this pattern.
	Extra     int    // How many extra patterns to go below start at end.
	Hands     int    // How many hands to play
}

The description of a scale exercise. This describes how to build a scale exercise.

type Voicing

type Voicing struct {
	Chords [][]Note `json:"chords"`
	Type   string   `json:"type"`
}

Jump to

Keyboard shortcuts

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