Documentation
¶
Index ¶
- func ConvertNotes(notes [][]int, startBeat int) (song *music.Music)
- type AI
- func (m *AI) Analyze(notes music.Notes) (analyzedNotes [][]int)
- func (m *AI) Couple(index int, coupling []int)
- func (m *AI) GenerateNote(prevValue []int, prevPrevValue []int) (curValue []int)
- func (m *AI) Learn(notes music.Notes) (err error)
- func (ai *AI) Learn2(notes music.Notes) (err error)
- func (ai *AI) Learn3(notes music.Notes) (err error)
- func (ai *AI) Learn4(notes music.Notes) (err error)
- func (m *AI) Lick(startBeat int) (lick *music.Music, err error)
- func (ai *AI) Lick2(startBeat int) (lick *music.Music, err error)
- func (ai *AI) Lick3(startBeat int) (lick *music.Music, err error)
- func (ai *AI) Lick4(startBeat int) (lick *music.Music, err error)
- type Pair
- type PairList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AI ¶
type AI struct { // BeatsBetweenLicks specifies the amount of space // between each lick before adding an "end" BeatsBetweenLicks int // 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 // contains filtered or unexported fields }
MarkovAI is an implementation of an AI that aims to improvise in realtime. In this implementation, the current history of real playing is used to generate transition probabilities which are used to reconstruct new licks.
func (*AI) Couple ¶
Couple will take an index and a coupling and attach to the matrix. For example, to couple current Velocity to previous Pitch and previous Velocity, you would use Couple(1,[]int{-1,-1,0,0}), where {0,1,2,3} -> {Pitch,Velocity,Duration,Lag}.
func (*AI) GenerateNote ¶
func (*AI) Lick ¶
Lick generates a sequence of chords using the Markov probabilities. Must run Learn() beforehand.
func (*AI) Lick2 ¶
Lick2 generates a sequence of chords using the Markov probabilities. Must run Learn2() beforehand.