Package eu.bandm.sighkn
Class SigSequencer
java.lang.Object
eu.bandm.sighkn.SigSequencer
- All Implemented Interfaces:
CompilableControlFlow
,Realtime
,SequencerPanel.AbstractSequencer
,Runnable
Sequencer for sig data.
Usage is one-shot: construct and load data. Then multiple playing possible.
One Sequencer maintains
The
FIXME loop ist ZEIT gesteuert "atEnd" aber zeilennummerngesteuert. Keine zwangs-synchronisierung!?!?
One Sequencer maintains
SigSequencer.Column
objects. These serve as (passive)
Data source.
The
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.
FIXME loop ist ZEIT gesteuert "atEnd" aber zeilennummerngesteuert. Keine zwangs-synchronisierung!?!?
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
class
class
static interface
class
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final int
protected final SigSequencer.Column[]
protected float
protected int
protected List<SigSequencer.Reaction>
protected final float
protected List<SigSequencer.Reaction>
protected boolean
protected float
protected boolean
protected float
protected final Class[]
(package private) static final Pattern
(package private) static final Pattern
protected final float
protected boolean
protected float
protected float
protected int
Fields inherited from interface eu.bandm.sig.adlib.Realtime
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_do_run
(float newTime) ASSUME running => loaded =>void
Will be executed whenever the last data line is finished.void
Will be executed whenever a new data line is entered.protected void
checkColumn
(int i) void
dump()
floatColumn
(int i) float
float
intColumn
(int i) boolean
isLoaded()
void
jumpTo
(float f) f in msecvoid
void
load_duration
(float deltaT) void
loadTextLines
(File file) ASSUME time is given as delta-duration in milli-secondsvoid
noLoop()
void
postLoad()
float
rowNumberToTime
(int num) time in msecvoid
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 .setMicrosecondPositionstringColumn
(int i) int
timeToRowNumber
(float time) time in msecMethods 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.Realtime
afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, times, times
Methods inherited from interface eu.bandm.sighkn.SequencerPanel.AbstractSequencer
getMinPosition_msec
-
Field Details
-
columnCount
protected final int columnCount -
outputClasses
-
columns
-
rowIndex
-
index2when
-
frequency
protected final float frequency -
period
protected final float period -
currentRowNumber
protected int currentRowNumber -
currentLocalTime
protected float currentLocalTime -
tempoFactor
protected float tempoFactor -
loaded
protected boolean loaded -
running
protected boolean running -
loopMode
protected boolean loopMode -
atEnd
protected boolean atEnd -
loopStart
protected float loopStart -
loopEnd
protected float loopEnd -
lineListeners
-
endListeners
-
x_now
protected float x_now -
x_row
protected int x_row -
pattern_upto_dquote
-
pattern_upto_squote
-
-
Constructor Details
-
SigSequencer
- Parameters:
float
- frequency of execution, needed for duration calculation.outputClasses
- list of classes, describing the columns of the data
-
-
Method Details
-
postLoad
public void postLoad() -
load
-
timeToRowNumber
public int timeToRowNumber(float time) time in msec -
rowNumberToTime
public float rowNumberToTime(int num) time in msec -
isLoaded
public boolean isLoaded()- Specified by:
isLoaded
in interfaceSequencerPanel.AbstractSequencer
-
getMaxPosition_msec
public float getMaxPosition_msec()- Specified by:
getMaxPosition_msec
in interfaceSequencerPanel.AbstractSequencer
-
getPosition_msec
public float getPosition_msec()- Specified by:
getPosition_msec
in interfaceSequencerPanel.AbstractSequencer
-
setPosition_msec
public void setPosition_msec(float newpos) - Specified by:
setPosition_msec
in interfaceSequencerPanel.AbstractSequencer
-
addNextLineListener
Will be executed whenever a new data line is entered. -
addEndReachedListener
Will be executed whenever the last data line is finished. -
loadTextLines
ASSUME time is given as delta-duration in milli-seconds1_500 1 1 1 2_500 2 2 2
... reads as:
Starting with now=0.0, the data triple "1 1 1" is valid vor 1.5 seconds;
then, from now=1.5 to now=4.0, the data triple "2 2 2" is valid.
It stays valid thereafter if the file is ended.
(=> the very last duration has no significance at all.)
FIXME Scanner.nextLine benutzen! LineNumberReader kann raus.- Throws:
FileNotFoundException
IOException
-
dump
public void dump() -
startLoadingAll
public void startLoadingAll(int i) -
load_duration
public void load_duration(float deltaT) -
stop
public 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- Specified by:
stop
in interfaceSequencerPanel.AbstractSequencer
-
start
public void start()- Specified by:
start
in interfaceSequencerPanel.AbstractSequencer
-
setLoop
public void setLoop(float from, float to) -
noLoop
public void noLoop() -
jumpTo
public void jumpTo(float f) f in msec -
setTempo
public void setTempo(float f) additional factor with which all durationas are multiplied. -
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.
-
_do_run
protected void _do_run(float newTime) ASSUME running => loaded => -
checkColumn
protected void checkColumn(int i) -
floatColumn
-
intColumn
-
stringColumn
-