tur/core
constant
(constant [val])
create a signal that always returns the same value.
| val | the 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
time-signal
(time-signal [t])
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
sample
(sample [sig t])
evaluate a signal at a specific time point.
| sig | the Signal to query | |
| t | the time point at which to sample |
The signal value of type a at time t.
(sample (constant 3.0) 0.0) ; => 3.0
map-signal
(map-signal [f sig])
lift a pure function to operate on signals pointwise.
| f | function from a to b | |
| sig | input 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)
pair-signals
(pair-signals [sig-a sig-b])
zip two signals into a product signal.
| sig-a | first signal | |
| sig-b | second signal |
A signal whose value at time t is a Pair of both signals' values.
(pair-signals freq-sig amp-sig)
left-signal
(left-signal [sig-a])
inject a signal into the Left branch.
| sig-a | signal to inject |
A signal whose samples are (sig-a t). Note: Returns the raw signal value since Left/Either are not yet implemented.
right-signal
(right-signal [sig-b])
inject a signal into the Right branch.
| sig-b | signal to inject |
A signal whose samples are (sig-b t). Note: Returns the raw signal value since Right/Either are not yet implemented.
Internal definitions
__signal_call1-- call a signal (function of time) at time t.