public class FloatSamplePlayer extends FloatClockedSignalSource
addSegment (null na. duration) -> play pause of given duration addSegment (float[] 1 na na -> play segment once addSegment (float[] -1 start end -> loop infinite addSegment (float[] n start end -> loop n times, then play tail (or next segment) end_loop(n) --> overwrite loopCount with "n" clear() --> hard delete allCf FloatPfg
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 boolean |
_noDC |
protected float[][] |
data |
protected float[] |
delay
duration of delay.
|
protected float |
freq |
protected int[] |
from |
protected FloatSignalSource |
increment |
protected int |
index |
protected int[] |
loopcount
-1 for infinitely often; will be changed dynamically later.
|
protected float |
period |
protected double |
phase |
protected int |
qSize |
protected int |
read |
protected int[] |
start
start index into data array.
|
protected double |
time |
protected int[] |
to |
protected int |
width |
protected int |
write |
out
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
Constructor and Description |
---|
FloatSamplePlayer(float freq,
int qSize,
int width,
FloatSignalSource increment) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_add(float[] data,
float delay,
int from,
int to,
int loopcount) |
protected boolean |
_add(float[] data,
int loopcount) |
protected void |
_noDC() |
protected void |
checkLoopCount(int n) |
void |
clear() |
void |
clear(float out) |
protected void |
complete() |
void |
dump() |
void |
end_loop() |
void |
end_loop(int n)
Used to replace an infinite loop count with only "n" remaining loops.
|
boolean |
play_loop(float[] data) |
boolean |
play_loop(float[] data,
int from,
int to) |
boolean |
play_ntimes(float[] data,
int loopcount) |
boolean |
play_ntimes(float[] data,
int from,
int to,
int loopcount) |
boolean |
play_once(float[] data) |
boolean |
play_once(float[] data,
int from,
int to) |
boolean |
play_pause(float duration) |
void |
run()
GLO IN phase points to the next sample to be output, relative to the start of the
currently played range.
|
void |
set_noDC(boolean n)
Setting to "true" means not to output a constant "direct current" value !=0f
in pauses and after data end.
|
void |
set(float out) |
delayedBy, delayedWith, doCompileDataFlow, get, getAsFloat, iterate, logged, logged, random, randomNormal, randomUniform, repeat, slide, suppliedBy, suppliedBy, switchOver
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, sequence, times, times
protected final int qSize
protected final int width
protected final float freq
protected final float period
protected final FloatSignalSource increment
protected boolean _noDC
protected final float[][] data
protected final float[] delay
protected final int[] start
protected final int[] from
protected final int[] to
protected final int[] loopcount
protected int write
protected int read
protected int index
protected double phase
protected double time
public FloatSamplePlayer(float freq, int qSize, int width, FloatSignalSource increment)
public void run()
public void clear()
public void set(float out)
public void clear(float out)
public void set_noDC(boolean n)
protected void _noDC()
protected void complete()
public boolean play_pause(float duration)
public boolean play_once(float[] data)
public boolean play_once(float[] data, int from, int to)
public boolean play_loop(float[] data)
public boolean play_loop(float[] data, int from, int to)
public boolean play_ntimes(float[] data, int loopcount)
public boolean play_ntimes(float[] data, int from, int to, int loopcount)
public void end_loop()
public void end_loop(int n)
protected void checkLoopCount(int n)
protected boolean _add(float[] data, int loopcount)
protected boolean _add(float[] data, float delay, int from, int to, int loopcount)
public void dump()