Module Tportmidi.Events

Buffers of events

type msg = int32

The type for MIDI messages. These are structured by portmidi as follows:

  • (m land 0xFF) is the MIDI status byte.
  • (m lsr 8) land 0xFF is first data byte.
  • (m lsr 16) land 0xFF is the second data byte.

Consult this document for the semantics of messages.

TODO. Should we try to get ints for easier OCaml manipulation ?

type timestamp = int32

The type for MIDI time stamps.

type t

The type for buffer of events.

val create : int -> t

create count is a buffer with count events.

val msg : t -> int -> msg

msg evs i is the message of the ith event in evs.

val timestamp : t -> int -> timestamp

timestamp evs i is the timestamp of the ith event in evs.

val set_msg : t -> int -> msg -> unit

set_msg evs i msg sets the message of the ith event in evs to msg.

val set_timestamp : t -> int -> timestamp -> unit

set_timetamp evs i t sets the timestamp of the ith event in evs to t.