Class Midi.Pattern

A timed collection of MIDI notes. The collection is indexed and can be iterated:

pattern <- Midi.Pattern()
// [add some notes]
pattern[0] // the first Midi.NoteEvent
foreach(event in pattern) {
// event.note, event.measure
}

Constructors

Pattern()

Properties

size deprecated, please use len()

Methods

add(Midi.Note note, float measure) add a Midi.Note to this pattern.
len() the number of MIDI notes in this pattern
note(integer index) return the note at the given index
notes(function handler)
print()
slice(float start, float end)
transpose(integer amount)

Constructor Documentation


Pattern()

Property Documentation


integer size

Deprecated, please use len()

Method Documentation


void add(Midi.Note note, float measure)

Add a Midi.Note to this pattern.

Parameters


integer len()

The number of MIDI notes in this pattern

Returns


Midi.Note note(integer index)

Return the note at the given index

Parameters

Returns


void notes(function handler)

Parameters


void print()


Midi.Pattern slice(float start, float end)

Parameters

Returns


void transpose(integer amount)

Parameters



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.