package llama_core

  1. Overview
  2. Docs

Module Signal.TriggerSource

type 'a signal := 'a t
Sourcetype 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)

Sourceval 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.

Sourceval 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).

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