Package eu.bandm.sig.adlib2.lib
Class DoubleEnvelope
java.lang.Object
eu.bandm.sig.adlib2.AbstractProcess
eu.bandm.sig.adlib2.DoubleStoredSignalSource
eu.bandm.sig.adlib2.lib.DoubleEnvelope
- All Implemented Interfaces:
AbstractClockedSignalSource,AbstractSignalSource,Component,DoubleClockedSignalSource,DoubleSignalSource,AbstractEnvelope,Process,DoubleSupplier
Parameter function: piecewise defined (control-rate) function, for
forming acoustic note events.
Duration are given in seconds.
\ \
\ \
\ \
\....limit \
|dura_seg|
|..... dura_env..|
change to next segment determined by ...
out<=/>=fin or dt
increment value determined by ...
==0 or !=0
=inc =inc OR = fin/dt
dt_inc fin_inc
dtSeg_inc dt inc duration of this segment, inc given verbatim
dtSeg_fin dt fin duration of this segment, inc calculated
as fin-out / dt
dtEnv_inc dt inc ends at time point of envelope,
inc given verbatim
dtEnv_fin dt fin ends at time point of envelope,
inc calculated as fin-out/dt
inc_fin inc fin inc and fin given verbatim
dtSeg_inc dt =0 hold current value
dtEnv_inc dt =0 hold current value
dtSeg_fin =0 fin jump to out=v, start next segment immediately
end,fermata --- --- array at this index does not change "out" value
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.bandm.sig.adlib2.lib.AbstractEnvelope
AbstractEnvelope.ModeNested classes/interfaces inherited from interface eu.bandm.sig.adlib2.DoubleClockedSignalSource
DoubleClockedSignalSource.AbstractRandomNested classes/interfaces inherited from interface eu.bandm.sig.adlib2.Process
Process.Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractEnvelope.Mode[]protected double[]protected intprotected double[]protected doubleprotected doubleprotected intprotected doubleprotected boolean(package private) AbstractEnvelope.Modeprotected doubleThe time after the last reset = "start of note".protected doubleTaken from the period duration of a ConstantRealtimeContext, thus in seconds.protected doubleThe rest duration for the current segmentprotected intFields inherited from class eu.bandm.sig.adlib2.DoubleStoredSignalSource
outFields inherited from interface eu.bandm.sig.adlib2.AbstractClockedSignalSource
STREAM_CHARACTERISTICS, STREAM_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionDoubleEnvelope(int segments) DoubleEnvelope(ConstantRealtimeContext ct, int segments) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSegment(double dt_inc, double fin_inc, AbstractEnvelope.Mode ctr) protected voiddoStep()protected voiddump(PrintStream ps) voidendFerm()getRestarter(BooleanSignalSource reset) voidinit()Initializes the state of this process.protected voidEnter the next segment, prepare all registers for the next invocation of "step()."voidrestart()setInitValue(double initValue) setLoopMode(boolean loopMode) voidsetRealtimeContext(RealtimeContext context) Sets the realtime context of this process.voidsetValues(double[] dt_inc, double[] fin_inc, AbstractEnvelope.Mode[] ctr) voidstep()Signals a time event, executing a transition step for this process to the next observable state.Methods inherited from class eu.bandm.sig.adlib2.DoubleStoredSignalSource
getAsDoubleMethods inherited from class eu.bandm.sig.adlib2.AbstractProcess
getRealtimeContext, hasFixedConstantRealtimeContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.bandm.sig.adlib2.DoubleClockedSignalSource
after, drain, drain, during, spliterator, streamMethods inherited from interface eu.bandm.sig.adlib2.DoubleSignalSource
abs, add, asDouble, asFloat, asInt, ceil, clockedAfter, defined, delayed, delayed, divide, equal, floor, getConstantAsDouble, getValueClass, glidingAverage, glidingStandardDeviation, glidingSum, glidingVariance, greaterOrEqual, greaterThan, guard, hasConstantAsDouble, invariant, lessOrEqual, lessThan, map, max, min, modulo, multiply, negate, negative, nonEqual, nonnegative, nonpositive, nonzero, notANumber, positive, power, probe, relateWith, sampleAndHold, selectAffine, series, sqrt, stored, subtract, zero, zeroCrossing, zipWithMethods inherited from interface eu.bandm.sig.adlib2.Process
afterEvery, andThen, conditional, every, every, getProcess
-
Field Details
-
samplingPeriode
protected double samplingPeriodeTaken from the period duration of a ConstantRealtimeContext, thus in seconds. -
dt_inc
protected double[] dt_inc -
fin_inc
protected double[] fin_inc -
ctr
-
initValue
protected double initValue -
endFerms
protected int endFerms -
loopMode
protected boolean loopMode -
increment
protected double increment -
finalValue
protected double finalValue -
now
protected double nowThe time after the last reset = "start of note". -
timer
protected double timerThe rest duration for the current segment -
index
protected int index -
mode
-
writeIndex
protected int writeIndex
-
-
Constructor Details
-
DoubleEnvelope
-
DoubleEnvelope
-
DoubleEnvelope
public DoubleEnvelope() -
DoubleEnvelope
public DoubleEnvelope(int segments)
-
-
Method Details
-
endFerm
public void endFerm() -
setLoopMode
-
setInitValue
-
setRealtimeContext
Description copied from class:AbstractProcessSets the realtime context of this process.If the realtime context has been fixed at creation time, this implementation will not allow it to be set to a different reference.
- Specified by:
setRealtimeContextin interfaceProcess- Overrides:
setRealtimeContextin classAbstractProcess- Parameters:
context- the new realtime context of this process, ornullif not specified
-
addSegment
-
setValues
-
step
public void step()Description copied from interface:ProcessSignals a time event, executing a transition step for this process to the next observable state.The state of the process after successful completion of this method should be the n-th observable state, if
Process.step()has been invoked n times since the last initialization viaProcess.init(). The behavior of this method is unspecified ifProcess.init()has not been invoked before.FIXME:
Process.setRealtimeContext(eu.bandm.sig.adlib2.RealtimeContext)If this method completes abruptly by throwing an error or unchecked exception, the process state should be considered invalid.
-
doStep
protected void doStep() -
nextSegment
protected void nextSegment()Enter the next segment, prepare all registers for the next invocation of "step()."mode dt_inc fin_inc dt<>_fin timer finalValue dtSeg_fin 0 finalValue dt<>_inc timer increment inc_fin increment finalValue -
restart
public void restart() -
init
public void init()Description copied from interface:ProcessInitializes the state of this process. The state is initialized such that the first subsequent call toProcess.step()transitions to the first specified observable state.The default implementation does nothing.
-
getRestarter
-
dump
-