package mm

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Operations on audio data.

val samples_of_seconds : int -> float -> int

At given sample rate, number of samples in given amount of time.

val seconds_of_samples : int -> int -> float

At given sample rate, duration of given number of samples.

val lin_of_dB : float -> float

Convert decibels to linear coefficient.

val dB_of_lin : float -> float

Convert linear coefficient to decibels.

module Sample : sig ... end

Operations on samples.

module Note : sig ... end

Operations on notes.

module Mono : sig ... end

Operations on mono buffers (with only one channel).

type t = Mono.t array

An audio buffer.

type buffer = t
val create : int -> int -> t

create chans len creates a buffer with chans channels and len samples as duration.

val make : int -> int -> float -> t
val of_array : float array array -> t
val to_array : t -> float array array
val create_same : t -> t

Create a buffer with the same number of channels and duration as the given buffer.

val clear : t -> unit

Clear the buffer (sets all the samples to zero).

val copy : t -> t

Copy the given buffer.

val append : t -> t -> t
val channels : t -> int
val length : t -> int

Length of a buffer in samples.

val to_mono : t -> Mono.t

Convert a buffer to a mono buffer by computing the mean of all channels.

val of_mono : Mono.t -> t

Convert a mono buffer into a buffer. Notice that the original mono buffer is not copied an might thus be modified afterwards.

val deinterleave : int -> (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t -> t
module U8 : sig ... end
module S16LE : sig ... end
module S16BE : sig ... end
module S24LE : sig ... end
module S32LE : sig ... end
val resample : ?mode:[ `Nearest | `Linear ] -> float -> t -> t
val blit : t -> t -> unit
val sub : t -> int -> int -> t
val clip : t -> unit
val noise : t -> unit
val amplify : float -> t -> unit

Amplify a portion of the buffer by a given coefficient.

val pan : float -> t -> unit

Pan a stereo buffer from left to right (the buffer should have exactly two channels!). The coefficient should be between -1. and 1..

val add : t -> t -> unit
val add_coeff : t -> float -> t -> unit
module Buffer_ext : sig ... end

Buffers of variable size. These are particularly useful for temporary buffers.

module Ringbuffer : sig ... end

Circular ringbuffers.

module Ringbuffer_ext : sig ... end
module Analyze : sig ... end
module Effect : sig ... end

Audio effects.

module Generator : sig ... end

Sound generators.

module IO : sig ... end

Operation for reading and writing audio data from files, streams or devices.

OCaml

Innovation. Community. Security.