Package eu.bandm.sighkn
Class Apdsr
java.lang.Object
eu.bandm.sig.adlib.FloatClockedSignalSource
eu.bandm.sighkn.Apdsr
- All Implemented Interfaces:
CompilableControlFlow
,CompilableDataFlow
,FloatSignalSource
,FloatSupplier
,Realtime
,SignalSource<Float>
,Runnable
,Supplier<Float>
APDSR.
Retriggerable.
"p" = "peak" is optional, if == null it defaults to 1.0f, modeling the conventional "Adsr".
Gate is true if input !=0.
Trigger is modelled by any change in the event number = the int source in "trigger".
Execution is re-triggerable, i.e. starts with attack whenever trigger changes.
"a", "d" and "r" are given in "units per msec"; "p" and "s" in those very "units", whatever these may be.
All inputs are fully dynamic, i.e. call "getAsFloat()" in every run. ("S" is only fetched once at beginning of phase "S", since not needed further)
(Perhaps a variant with such local sampling for all four inputs is sensible?)
Retriggerable.
"p" = "peak" is optional, if == null it defaults to 1.0f, modeling the conventional "Adsr".
Gate is true if input !=0.
Trigger is modelled by any change in the event number = the int source in "trigger".
Execution is re-triggerable, i.e. starts with attack whenever trigger changes.
"a", "d" and "r" are given in "units per msec"; "p" and "s" in those very "units", whatever these may be.
All inputs are fully dynamic, i.e. call "getAsFloat()" in every run. ("S" is only fetched once at beginning of phase "S", since not needed further)
(Perhaps a variant with such local sampling for all four inputs is sensible?)
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.bandm.sig.adlib.FloatSignalSource
FloatSignalSource.CompilableFloatBinaryOperator, FloatSignalSource.FloatAddOperator, FloatSignalSource.FloatDivOperator, FloatSignalSource.FloatMultOperator, FloatSignalSource.FloatSubOperator
Nested classes/interfaces inherited from interface eu.bandm.sig.adlib.SignalSource
SignalSource.AddOperator, SignalSource.CompilableBinaryOperator, SignalSource.Constant<A>, SignalSource.DivOperator, SignalSource.MultOperator, SignalSource.SubOperator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FloatSignalSource
protected final FloatSignalSource
protected final float
protected final IntSignalSource
protected int
protected final float
Used for the steepness inputs: what to increment in every runStep when "a" "d" "r" input value == 1.0f ?
1.0 / msec =^= (1 / freq) / (msec / freq) =^= (1_000 / freq) / runStepprotected final @Opt FloatSignalSource
protected final FloatSignalSource
protected final FloatSignalSource
protected int
protected final IntSignalSource
Fields inherited from class eu.bandm.sig.adlib.FloatClockedSignalSource
out
Fields inherited from interface eu.bandm.sig.adlib.FloatSignalSource
abs, add, clip, cos, div, E, exp, log, LOG2, metaGetAsFloat, mult, neg, PI, sin, sqrt, SQRT2, square, sub
Fields inherited from interface eu.bandm.sig.adlib.Realtime
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
-
Constructor Summary
ConstructorDescriptionApdsr
(int freq, FloatSignalSource a, @Opt FloatSignalSource p, FloatSignalSource d, FloatSignalSource s, FloatSignalSource r, IntSignalSource trigger, IntSignalSource gate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
Processes an event.void
setFinishedCallback
(@Opt Runnable finished) Methods inherited from class eu.bandm.sig.adlib.FloatClockedSignalSource
delayedBy, delayedWith, doCompileDataFlow, get, getAsFloat, iterate, logged, logged, random, randomNormal, randomUniform, repeat, slide, suppliedBy, suppliedBy, switchOver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.sig.adlib.FloatSignalSource
add, check, clocked, compileDataFlow, div, guard, logger, logger, map, mult, sub, zipWith, zipWith
Methods inherited from interface eu.bandm.sig.adlib.Realtime
afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, times, times
-
Field Details
-
a
-
d
-
s
-
r
-
p
-
trigger
-
gate
-
freq
protected final float freq -
multiplier
protected final float multiplierUsed for the steepness inputs: what to increment in every runStep when "a" "d" "r" input value == 1.0f ?
1.0 / msec =^= (1 / freq) / (msec / freq) =^= (1_000 / freq) / runStep -
state
protected int state -
lastEvent
protected int lastEvent -
finishedCallback
-
-
Constructor Details
-
Apdsr
public Apdsr(int freq, FloatSignalSource a, @Opt @Opt FloatSignalSource p, FloatSignalSource d, FloatSignalSource s, FloatSignalSource r, IntSignalSource trigger, IntSignalSource gate)
-
-
Method Details
-
setFinishedCallback
-
run
public void run()Description copied from interface:Realtime
Processes an event.Any implementation of this method should complete promptly and normally. In particular it must not block indefinitely.
-