package llama_core

  1. Overview
  2. Docs
type 'a signal := 'a t
type t

A boolean signal which is usually false but becomes true for a single sample in response to some event (e.g. a key press)

val rising_edge : ?init:bool -> bool signal -> t

Gate to trigger conversion. Takes a boolean signal and returns a boolean signal which is true for only the first sample that its input transitioned from false to true. The init argument is false by default and helps with constructing triggers from other types of signal. If init is true and the the input signal starts as true then the output signal won't trigger until the input becomes false and then true again.

val of_signal_unsafe : bool signal -> t

Takes a signal that is already in the format of a trigger (individual true values in mostly false values) and convert it into a trigger. Use this when manually constructing a trigger signal and you're sure it has the properties of a trigger signal (and isn't, say, a gate signal instead).

val to_signal : t -> bool signal
val sample : t -> Ctx.t -> bool
val never : t
val debug_print_sample_index_on_true : t -> t
OCaml

Innovation. Community. Security.