FloatClockedSignalSource
instead.@Deprecated public abstract class ClockedFloatSignalSource extends Object implements FloatSignalSource, SignalSource<Float>, Realtime
float
, which attains new values only at clock events.
Note that object creation is not a clock event; whether instances of this class have a meaningful signal value depends on the particular subclass.
Subclasses must implement the method Realtime.run()
, which should
set the field #out
to a new value.
FloatSignalSource.CompilableFloatBinaryOperator, FloatSignalSource.FloatAddOperator, FloatSignalSource.FloatDivOperator, FloatSignalSource.FloatMultOperator, FloatSignalSource.FloatSubOperator
SignalSource.AddOperator, SignalSource.CompilableBinaryOperator, SignalSource.Constant<A>, SignalSource.DivOperator, SignalSource.MultOperator, SignalSource.SubOperator
Modifier and Type | Field and Description |
---|---|
protected float |
out
Deprecated.
The current value.
|
abs, add, clip, cos, div, E, exp, log, LOG2, metaGetAsFloat, mult, neg, PI, sin, sqrt, SQRT2, square, sub
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
Modifier | Constructor and Description |
---|---|
protected |
ClockedFloatSignalSource()
Deprecated.
Creates a new instance with no specified initial value.
|
protected |
ClockedFloatSignalSource(float init)
Deprecated.
Creates a new instance with the given initial value.
|
Modifier and Type | Method and Description |
---|---|
ClockedFloatSignalSource |
delayedBy(int length)
Deprecated.
Creates a wrapper that emits the same sequence of values as this
object, but delayed by the given number of clock events.
|
ClockedFloatSignalSource |
delayedWith(float... initialValues)
Deprecated.
Creates a wrapper that emits the same sequence of values as this
object, but delayed by a given number of clock events, prepending
the given initial values.
|
Float |
get()
Deprecated.
Returns the current value of the signal.
|
float |
getAsFloat()
Deprecated.
Returns the current value of the signal.
|
Realtime |
logged(String name)
Deprecated.
Creates a wrapper that emits the same signal values as this
object, but produces a logging output as side effect on each
clock event.
|
Realtime |
logged(String name,
PrintStream out)
Deprecated.
Creates a wrapper that emits the same signal values as this
object, but produces a logging output as side effect on each
clock event.
|
static ClockedFloatSignalSource |
repeat(float... table)
Deprecated.
Creates an object that emits a given sequence of values,
proceeding cyclically at each clock event.
|
static ClockedFloatSignalSource |
slide(float sampleFreq,
float duration)
Deprecated.
Creates an object that emits a signal rising at clock events in
equal steps from
0 to 1 , with a given slope. |
static ClockedFloatSignalSource |
suppliedBy(float init,
FloatSupplier step)
Deprecated.
|
static ClockedFloatSignalSource |
suppliedBy(FloatSupplier supplier)
Deprecated.
|
ClockedFloatSignalSource |
switchOver(int countdown,
ClockedFloatSignalSource next)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, check, clip, clocked, compileDataFlow, constant, div, guard, logger, logger, lowerLogSpread, map, mult, project, project, project, sub, upperLogSpread, zipWith, zipWith
adHoc, afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, run, sequence, times, times
protected ClockedFloatSignalSource()
protected ClockedFloatSignalSource(float init)
init
- the initial value.public final float getAsFloat()
Any implementation of this method should be stateless; its invocation should not have any side effect on the emitter or the observer, except for real time passing until its completion.
getAsFloat
in interface FloatSignalSource
getAsFloat
in interface FloatSupplier
out
.public final Float get()
get
in interface FloatSignalSource
get
in interface SignalSource<Float>
get
in interface Supplier<Float>
out
.public static ClockedFloatSignalSource suppliedBy(FloatSupplier supplier)
public static ClockedFloatSignalSource suppliedBy(float init, FloatSupplier step)
public ClockedFloatSignalSource delayedBy(int length)
length
- the number of clock events to delay each signal
value.(length)
clock events.IllegalArgumentException
- if length < 0
.public ClockedFloatSignalSource delayedWith(float... initialValues)
initial
- the number of clock events to delay each signal
value.initialValues
prepended.IllegalArgumentException
- if initialValues == null
.public Realtime logged(String name)
name
- the name to associate with the current signal value
in logging output, or null
for anonymous output.FloatSignalSource.logger(String)
public Realtime logged(String name, PrintStream out)
name
- the name to associate with the current signal value
in logging output, or null
for anonymous output.out
- the output stream to use for logging.IllegalArgumentException
- if out == null
.FloatSignalSource.logger(String, PrintStream)
public static ClockedFloatSignalSource repeat(float... table)
table
- an array of the values to attain cyclicallytable[(n - 1) %
table.length]
at the n
-th clock event.public static ClockedFloatSignalSource slide(float sampleFreq, float duration)
0
to 1
, with a given slope.sampleFreq
- the number of clock events per time unit.duration
- the length of the rise in time units.0
at the
first clock event, rises to 1
in (duration *
sampleFreq)
steps, and remains 1
afterwards.public ClockedFloatSignalSource switchOver(int countdown, ClockedFloatSignalSource next)