Version: v1.0.0 Latest Latest

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

Go to latest
Published: Sep 4, 2017 License: GPL-3.0 Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type AI

type AI struct {
	// HighPassFilter only uses notes above a certain level
	HighPassFilter int

	// MinimumLickLength is the minimum number of notes for a lick
	MinimumLickLength int

	// MaximumLickLength is the maximum number of notes for a lick
	MaximumLickLength int

	// keep track of whether it is learning,
	// so learning can be done asynchronously
	IsLearning bool
	HasLearned bool

	// LinkLength is how many links should be used
	LinkLength int

	// WindowSize is how many total notes to include
	WindowSizeMin, WindowSizeMax int

	Jazzy          bool
	Stacatto       bool
	DisallowChords bool

	MaxChordDistance int
	TicksBerBeat     int
	// contains filtered or unexported fields

func New

func New(ticksPerBeat int) (ai *AI)

func (*AI) Learn

func (ai *AI) Learn(mus *music.Music) (err error)

func (*AI) Lick

func (ai *AI) Lick(startBeat int) (lick *music.Music, err error)

Lick generates a sequence of chords using the Markov probabilities. Must run Learn() beforehand.

type Chord

type Chord struct {
	Pitches  []int
	Velocity int
	Duration int
	Lag      int

Source Files

Jump to

Keyboard shortcuts

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