Module Msynth.Pattern

Patterns are small musical phrases or chords.

type 'event t = (float * float * 'event) list

Musical patterns. Events in patterns are (time,duration,event). All time units are bpm here.

val duration : 'a t -> float
val offset : float -> 'a t -> 'a0 t
val merge : (float * float * 'a) list -> (float * float * 'a) list -> 'a0 t
val append : 'a t -> 'b t -> 'c t
val concat : 'a t list -> 'a t
val repeat : int -> 'a t -> 'a0 t
val transpose : int -> [ `Chord of int list * 'a | `Nop | `Note of int * 'b ] t -> [ `Chord of int list * 'a | `Nop | `Note of int * 'b ] t
val amplify : float -> [ `Chord of 'a * float | `Nop | `Note of 'b * float ] t -> [ `Chord of 'a * float | `Nop | `Note of 'b * float ] t
val arpeggiate : ?note:float -> [< `Staccato | `Up | `Up_down ] -> [> `Chord of int list * 'b | `Note of int * 'b ] as 'a t -> 'c t

Arpeggiator.

val stream : ?loop:bool -> float -> (float * float * [< `Chord of int list * float | `Nop | `Note of int * float Note ]) list -> MIDI.stream

Convert a pattern to a stream of MIDI events.

val midi_drums : ?loop:bool -> float -> [> `Nop ] as 'a t -> 'b list Stream.t
val load_drums : string -> [> `Closed_hat of float | `Kick of float | `Nop | `Snare of float ] t