package llama_core

  1. Overview
  2. Docs

Module Llama_core.DslSource

include module type of struct include Signal end
Sourcemodule Ctx = Signal.Ctx
Sourcemodule Raw = Signal.Raw
Sourcetype 'a t = 'a Signal.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 map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
Sourceval map3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> 'd) -> 'd 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 scale : float -> float t -> float t
Sourceval scale_div : 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 debug_print_float_endline : float t -> float t
Sourceval debug_print_sample_index_on_true : bool t -> bool 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
Sourcemodule Trigger = Signal.Trigger
Sourcemodule Gate = Signal.Gate
Sourceval gate : bool t -> Gate.t
Sourcetype waveform =
  1. | Sine
  2. | Saw
  3. | Triangle
  4. | Pulse
  5. | Noise
Sourceval waveform_to_string : waveform -> string
Sourceval oscillator : ?pulse_width_01:float t -> waveform t -> float t -> float t
Sourceval noise_01 : unit -> float t
Sourceval noise : min:float t -> max:float t -> float t
Sourceval low_frequency_oscillator : ?pulse_width_01:float t -> ?reset_offset_01:float t -> waveform t -> float t -> Trigger.t -> float t
Sourceval low_frequency_oscillator_01 : ?pulse_width_01:float t -> ?reset_offset_01:float t -> waveform t -> float t -> Trigger.t -> float t
Sourceval clock_of_frequency_hz : float t -> Trigger.t

A clock signal with a given frequency in Hz

Sourceval clock_of_period_s : float t -> Trigger.t
Sourceval clock_divide : int -> Trigger.t -> Trigger.t
Sourceval ar_linear : gate:Gate.t -> attack_s:float t -> release_s:float t -> float t

Envelope generator with an attack and release parameter. This returns a signal which rises linearly to 1 when gate is true, and drops linearly to 0 when gate is false

Sourceval adsr_linear : gate:Gate.t -> attack_s:float t -> decay_s:float t -> sustain_01:float t -> release_s:float t -> float t
Sourcetype 'a sequencer_output = {
  1. value : 'a Signal.t;
  2. gate : Signal.Gate.t;
}
Sourcetype 'a sequencer_step = {
  1. value : 'a Signal.t;
  2. period_s : float Signal.t;
}
Sourceval sustained_step_sequencer : float sequencer_step option list -> Signal.Trigger.t -> float sequencer_output
Sourceval generic_step_sequencer : 'a sequencer_step list -> Signal.Trigger.t -> 'a sequencer_output
Sourceval random_sequencer : 'a t list -> float t -> Signal.Trigger.t -> 'a sequencer_output
Sourceval value_sequencer : 'a t list -> Signal.Trigger.t -> 'a t
Sourceval butterworth_low_pass_filter : ?filter_order_half:int -> float t -> cutoff_hz:float t -> float t
Sourceval butterworth_high_pass_filter : ?filter_order_half:int -> float t -> cutoff_hz:float t -> float t
Sourceval chebyshev_low_pass_filter : ?filter_order_half:int -> float t -> cutoff_hz:float t -> resonance:float t -> float t
Sourceval chebyshev_high_pass_filter : ?filter_order_half:int -> float t -> cutoff_hz:float t -> resonance:float t -> float t
Sourceval sample_and_hold : float t -> Trigger.t -> float t
Sourceval sample_player_mono : floatarray -> Trigger.t -> float t
Sourceval bitwise_trigger_sequencer : int -> int t list -> Trigger.t -> Trigger.t list
Sourceval delay : 'a t -> time_s:float t -> fill:'a -> 'a t
Sourceval clock_delay : float -> Trigger.t -> Trigger.t
Sourceval periodic_gate : frequency_hz:float t -> duty_01:float t -> Gate.t
Sourceval feedback : f:(float t -> float t) -> float t -> float t

feedback ~f s adds its previous output modifier by f to its input.

Sourceval echo : f:(float t -> float t) -> delay_s:float t -> float t -> float t

echo ~f ~delay_s s adds its own output to its input, modified by f, after a delay of delay_s seconds.

Sourceval lazy_amplifier : float t -> volume:float t -> float t
Sourceval saturate : float t -> boost:float t -> threshold:float t -> float t
OCaml

Innovation. Community. Security.