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()

Methods

add(Midi.Note note, float measure) add a Midi.Note to this pattern.
add(Midi.Pattern pattern, float measure) add the notes from another Midi.Pattern to this pattern.
filter(function filter) filter the notes in this pattern to create a new Midi.Pattern
len() the number of MIDI notes in this pattern
sequence() create a sequence from the note on/off events in this pattern
slice(float start, float end)
transpose(integer amount) returns a new pattern object containing the notes from this pattern transposed by the given amount.

Constructor Documentation


Pattern()

Method Documentation


void add(Midi.Note note, float measure)

Add a Midi.Note to this pattern.

Parameters


void add(Midi.Pattern pattern, float measure)

Add the notes from another Midi.Pattern to this pattern.

Parameters


Midi.Pattern filter(function filter)

Filter the notes in this pattern to create a new Midi.Pattern

Parameters

Returns


integer len()

The number of MIDI notes in this pattern

Returns


Midi.Sequence sequence()

Create a sequence from the note on/off events in this pattern

Returns


Midi.Pattern slice(float start, float end)

Parameters

Returns


Midi.Pattern transpose(integer amount)

Returns a new pattern object containing the notes from this pattern transposed by the given amount.

Parameters

Returns



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