No matching definitions.

signal/core

src/signal/core.tur
defn

constant

(constant [val :float])

create a signal that always returns the same value.

valthe constant value to emit at every time point

A function Time -> a that ignores time and returns val.

((constant 0.5) 2.0)  ; => 0.5
defn

time-signal

(time-signal [t :float] :float)

a signal that returns the current time at each sample.

Signal<Time> whose value equals the query time t.

(time-signal 2.0)  ; => 2.0
defn

sample

(sample [^fat sig : (fn [float])

evaluate a signal at a specific time point.

sigthe Signal to query
tthe time point at which to sample

The signal value of type a at time t.

(sample (constant 3.0) 0.0)  ; => 3.0
defn

map-signal

(map-signal [^fat f : (fn [float])

lift a pure function to operate on signals pointwise.

ffunction from a to b
siginput signal of type Signal<a>

Signal<b> where each sample is f applied to the corresponding input sample.

(map-signal (fn [x] (* x 2.0)) my-sig)
defn

pair-signals

(pair-signals)

zip two signals into a product signal.

sig-afirst signal
sig-bsecond signal

A signal whose value at time t is a Pair of both signals' values.

(pair-signals freq-sig amp-sig)
Internal definitions
__sig-pair-- local heap-allocated 2-cell pair (fst/snd as float).