Module Mu.Music

Music.

Music

type dur = Q.t

The type for durations in whole notes units.

module Dur : sig ... end

Durations.

module Mode : sig ... end

Music modes.

module Phrase : sig ... end

Music phrasing.

module Ctrl : sig ... end

Music control.

module Prim : sig ... end

Music primitives.

type 'a t = [
  1. | `Prim of 'a Prim.t
    (*

    Interpret primitive.

    *)
  2. | `Seq of 'a t * 'a t
    (*

    Interpret in sequence.

    *)
  3. | `Par of 'a t * 'a t
    (*

    Interpret in parallel.

    *)
  4. | `Ctrl of Ctrl.t * 'a t
    (*

    Interpret with control.

    *)
]

The type for music with notes of type 'a.

val prim : 'a Prim.t -> 'a t

prim p is `Prim p, interprets primitive p.

val seq : 'a t -> 'a t -> 'a t

seq m0 m1 is `Seq (m0, m1), interprets m0 followed by m1.

val par : 'a t -> 'a t -> 'a t

par m0 m1 is `Par (m0, m1), interprets m0 in parallel with m1.

val ctrl : Ctrl.t -> 'a t -> 'a t

ctrl c m is `Ctrl (c, m), applies control c to m.

Properties

val dur : 'a t -> dur

dur m is m's duration.

Traversals

val map : ('a -> 'b) -> 'a t -> 'b t

map f m maps m's notes with f.

val map_prims : ('a Prim.t -> 'b Prim.t) -> 'a t -> 'b t

map_prims f m maps m's primitives with f.

val fold : prim:('a Prim.t -> 'b) -> seq:('b -> 'b -> 'b) -> par:('b -> 'b -> 'b) -> ctrl:(Ctrl.t -> 'b -> 'b) -> 'a t -> 'b

fold ~prim ~seq ~par ~ctrl m folds over m's constructors using prim, seq, par and ctrl.