package llama_core

  1. Overview
  2. Docs

Module Llama_core.SignalSource

Sourcemodule Ctx : sig ... end
Sourcemodule Raw : sig ... end
Sourcetype 'a t
Sourceval of_raw : 'a Raw.t -> 'a t
Sourceval of_ref : 'a ref -> 'a t
Sourceval sample : 'a t -> Ctx.t -> 'a
Sourceval map : 'a t -> f:('a -> 'b) -> 'b t
Sourceval both : 'a t -> 'b t -> ('a * 'b) t
Sourceval const : 'a -> 'a t
Sourceval var : 'a -> 'a t * 'a ref
Sourceval silence : float t
Sourceval never : bool t
Sourceval trigger : ?init:bool -> bool t -> bool t
Sourceval scale : float -> float t -> float t
Sourceval offset : float -> float t -> float t
Sourceval exp_01 : float -> float t -> float t

The function f(x) = exp(k * (x - a)) - b ...where a and b are chosen so that f(0) = 0 and f(1) = 1. The k parameter controls how sharp the curve is. It approaches a linear function as k approaches 0. k = 0 is special cased as a linear function for convenience.

Sourceval debug : 'a t -> f:('a -> unit) -> 'a t
Sourceval to_01 : float t -> float t

Takes a signal assumed to be in the range -1..1 and shifts and scales it to be in the range 0..1

Sourceval recip : float t -> float t
Sourceval sum : float t list -> float t
Sourceval mean : float t list -> float t
Sourceval add : float t -> float t -> float t
Sourceval (+..) : float t -> float t -> float t
Sourceval mul : float t -> float t -> float t
Sourceval (*..) : float t -> float t -> float t
Sourceval sub : float t -> float t -> float t
Sourceval (-..) : float t -> float t -> float t
Sourceval div : float t -> float t -> float t
Sourceval (/..) : float t -> float t -> float t