public class SigSequencer extends Object implements Realtime, SequencerPanel.AbstractSequencer
SigSequencer.Column
objects. These serve as (passive)
Data source.
run()
method counts down time and updates the values returned by each
SigSequencer.Column
. This method updates the internal now
and uses
rowIndex
to determine whether to switch to the next row number.
Modifier and Type | Class and Description |
---|---|
protected class |
eu.bandm.sighkn.SigSequencer.Column<A> |
class |
SigSequencer.FloatColumn |
class |
SigSequencer.IntColumn |
static interface |
SigSequencer.Reaction |
class |
SigSequencer.StringColumn |
Modifier and Type | Field and Description |
---|---|
protected boolean |
atEnd |
protected int |
columnCount |
protected eu.bandm.sighkn.SigSequencer.Column[] |
columns |
protected float |
currentLocalTime |
protected int |
currentRowNumber |
protected List<SigSequencer.Reaction> |
endListeners |
protected float |
frequency |
protected List<Float> |
index2when |
protected List<SigSequencer.Reaction> |
lineListeners |
protected boolean |
loaded |
protected float |
loopEnd |
protected boolean |
loopMode |
protected float |
loopStart |
protected Class[] |
outputClasses |
(package private) static Pattern |
pattern_upto_dquote |
(package private) static Pattern |
pattern_upto_squote |
protected float |
period |
protected TreeMap<Float,Integer> |
rowIndex |
protected boolean |
running |
protected float |
tempoFactor |
protected float |
x_now |
protected int |
x_row |
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
Constructor and Description |
---|
SigSequencer(float frequency,
Class... outputClasses) |
Modifier and Type | Method and Description |
---|---|
protected void |
_do_run(float newTime)
ASSUME running => loaded =>
|
void |
addEndReachedListener(SigSequencer.Reaction r)
Will be executed whenever the last data line is finished.
|
void |
addNextLineListener(SigSequencer.Reaction r)
Will be executed whenever a new data line is entered.
|
protected void |
checkColumn(int i) |
void |
dump() |
SigSequencer.FloatColumn |
floatColumn(int i) |
float |
getMaxPosition_msec() |
float |
getPosition_msec() |
SigSequencer.IntColumn |
intColumn(int i) |
boolean |
isLoaded() |
void |
jumpTo(float f)
f in msec
|
void |
load_duration(float deltaT) |
void |
load(Object[][] data) |
void |
loadTextLines(File file)
ASSUME time is given as delta-duration in milli-seconds
|
void |
noLoop() |
void |
postLoad() |
float |
rowNumberToTime(int num)
time in msec
|
void |
run()
Processes an event.
|
void |
setLoop(float from,
float to) |
void |
setPosition_msec(float newpos) |
void |
setTempo(float f)
additional factor with which all durationas are multiplied.
|
void |
start() |
void |
startLoadingAll(int i) |
void |
stop()
FOR GUI SEE projekte2017/.../klarduos/KlarDuosWS
USES eu.bandm.music.midi.SequencerPanel (( FIXME abstract to other sequencer types !?!)) USES javax.sound.midi.Sequencer Nomenklatur GUI PLAY PAUSE Nomenklatur javax.midi: sequencer.stop .start .setMicrosecondPosition |
SigSequencer.StringColumn |
stringColumn(int i) |
int |
timeToRowNumber(float time)
time in msec
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adHoc, afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, sequence, times, times
getMinPosition_msec
protected final int columnCount
protected final Class[] outputClasses
protected final eu.bandm.sighkn.SigSequencer.Column[] columns
protected final float frequency
protected final float period
protected int currentRowNumber
protected float currentLocalTime
protected float tempoFactor
protected boolean loaded
protected boolean running
protected boolean loopMode
protected boolean atEnd
protected float loopStart
protected float loopEnd
protected List<SigSequencer.Reaction> lineListeners
protected List<SigSequencer.Reaction> endListeners
protected float x_now
protected int x_row
static final Pattern pattern_upto_dquote
static final Pattern pattern_upto_squote
public SigSequencer(float frequency, Class... outputClasses)
float
- frequency of execution, needed for duration calculation.outputClasses
- list of classes, describing the columns of the datapublic void postLoad()
public void load(Object[][] data)
public int timeToRowNumber(float time)
public float rowNumberToTime(int num)
public boolean isLoaded()
isLoaded
in interface SequencerPanel.AbstractSequencer
public float getMaxPosition_msec()
getMaxPosition_msec
in interface SequencerPanel.AbstractSequencer
public float getPosition_msec()
getPosition_msec
in interface SequencerPanel.AbstractSequencer
public void setPosition_msec(float newpos)
setPosition_msec
in interface SequencerPanel.AbstractSequencer
public void addNextLineListener(SigSequencer.Reaction r)
public void addEndReachedListener(SigSequencer.Reaction r)
public void loadTextLines(File file) throws FileNotFoundException, IOException
1_500 1 1 1 2_500 2 2 2... reads as:
FileNotFoundException
IOException
public void dump()
public void startLoadingAll(int i)
public void load_duration(float deltaT)
public void stop()
stop
in interface SequencerPanel.AbstractSequencer
public void start()
start
in interface SequencerPanel.AbstractSequencer
public void setLoop(float from, float to)
public void noLoop()
public void jumpTo(float f)
public void setTempo(float f)
public void run()
Realtime
Any implementation of this method should complete promptly and normally. In particular it must not block indefinitely.
protected void _do_run(float newTime)
protected void checkColumn(int i)
public SigSequencer.FloatColumn floatColumn(int i)
public SigSequencer.IntColumn intColumn(int i)
public SigSequencer.StringColumn stringColumn(int i)