Module Performance.Ctx

Musical context.

The context is the context in which music is interpreted.

type 'a player

The type for players. TODO

type 'a t

The type for musical contexts.

val v : ?init:'a t -> ?time_s:time_s -> ?wn_dur_s:dur_s -> ?instrument:Instrument.t -> ?player:'a player -> ?transp:Pitch.rel -> ?volume:volume -> unit -> 'a t

v ~init () is a context with values from init (defaults to default) except for those overriden explictely.

val time_s : 'a t -> time_s

time_s c is the absolute performance time of c.

val wn_dur_s : 'a t -> dur_s

wn_dur_s c is the duration of a whole note in c.

val instrument : 'a t -> Instrument.t

instrument c is the instrument performing in c.

val player : 'a t -> 'a player

player c is the player performing in c.

val transp : 'a t -> Pitch.rel

transp c is the pitch transposition in c.

val volume : 'a t -> volume

volume c is the performance volumne in c.

val default : Pnote.t t

default is a default context for intepreting Pnote.t music in which:

  • time_s is
  • wn_dur_s is wn_dur_s ~bpm:120 ~beat:M.qn.
  • instrument is ``Acoustic_grand_piano.
  • player is TODO
  • transp is 0.
  • volume is 127.