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 = float array 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 length : t -> int

Length in samples.

val create_same : t -> t

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

val clear : t -> int -> int -> unit

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

val copy : t -> int -> int -> t

Copy the given buffer.

val append : t -> int -> int -> t -> int -> int -> t
val channels : t -> int
val to_mono : t -> int -> int -> 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 interleave : t -> int -> int -> Mono.t
val deinterleave : int -> Mono.t -> int -> int -> 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 -> int -> int -> t
val blit : t -> int -> t -> int -> int -> unit
val sub : t -> int -> int -> t
val clip : t -> int -> int -> unit
val noise : t -> int -> int -> unit
val squares : t -> int -> int -> float
val copy_to_ba : t -> int -> int -> (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array -> unit
val copy_from_ba : (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array -> t -> int -> int -> unit
val to_ba : t -> int -> int -> (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array
val copy_to_int16_ba : t -> int -> int -> (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array -> unit
val copy_from_int16_ba : (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array -> t -> int -> int -> unit
val to_int16_ba : t -> int -> int -> (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array
val amplify : float -> t -> int -> int -> unit

Amplify a portion of the buffer by a given coefficient.

val pan : float -> t -> int -> int -> 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 -> int -> t -> int -> int -> unit

Add two buffers of the same length, storing the result in the first one.

val add_coeff : t -> int -> float -> t -> int -> int -> unit

Add to the first buffer, the second buffer multiplied by a coefficient.

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

Extensible ringbuffers.

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.