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.FloatSubOperatorNested 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
FieldsModifier and TypeFieldDescriptionprotected final FloatSignalSourceprotected final FloatSignalSourceprotected final floatprotected final IntSignalSourceprotected intprotected final floatUsed 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 FloatSignalSourceprotected final FloatSignalSourceprotected final FloatSignalSourceprotected intprotected final IntSignalSourceFields inherited from class eu.bandm.sig.adlib.FloatClockedSignalSource
outFields 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, subFields inherited from interface eu.bandm.sig.adlib.Realtime
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS -
Constructor Summary
ConstructorsConstructorDescriptionApdsr(int freq, FloatSignalSource a, @Opt FloatSignalSource p, FloatSignalSource d, FloatSignalSource s, FloatSignalSource r, IntSignalSource trigger, IntSignalSource gate) -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Processes an event.voidsetFinishedCallback(@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, switchOverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.bandm.sig.adlib.FloatSignalSource
add, check, clocked, compileDataFlow, div, guard, logger, logger, map, mult, sub, zipWith, zipWithMethods 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:RealtimeProcesses an event.Any implementation of this method should complete promptly and normally. In particular it must not block indefinitely.
-