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
Nested ClassesModifier and TypeClassDescriptionprotected classclassclassstatic interfaceclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final intprotected final SigSequencer.Column[]protected floatprotected intprotected List<SigSequencer.Reaction>protected final floatprotected List<SigSequencer.Reaction>protected booleanprotected floatprotected booleanprotected floatprotected final Class[](package private) static final Pattern(package private) static final Patternprotected final floatprotected booleanprotected floatprotected floatprotected intFields inherited from interface eu.bandm.sig.adlib.Realtime
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_do_run(float newTime) ASSUME running => loaded =>voidWill be executed whenever the last data line is finished.voidWill be executed whenever a new data line is entered.protected voidcheckColumn(int i) voiddump()floatColumn(int i) floatfloatintColumn(int i) booleanisLoaded()voidjumpTo(float f) f in msecvoidvoidload_duration(float deltaT) voidloadTextLines(File file) ASSUME time is given as delta-duration in milli-secondsvoidnoLoop()voidpostLoad()floatrowNumberToTime(int num) time in msecvoidrun()Processes an event.voidsetLoop(float from, float to) voidsetPosition_msec(float newpos) voidsetTempo(float f) additional factor with which all durationas are multiplied.voidstart()voidstartLoadingAll(int i) voidstop()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) inttimeToRowNumber(float time) time in msecMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.bandm.sig.adlib.Realtime
afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, times, timesMethods 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:
isLoadedin interfaceSequencerPanel.AbstractSequencer
-
getMaxPosition_msec
public float getMaxPosition_msec()- Specified by:
getMaxPosition_msecin interfaceSequencerPanel.AbstractSequencer
-
getPosition_msec
public float getPosition_msec()- Specified by:
getPosition_msecin interfaceSequencerPanel.AbstractSequencer
-
setPosition_msec
public void setPosition_msec(float newpos) - Specified by:
setPosition_msecin 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:
FileNotFoundExceptionIOException
-
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:
stopin interfaceSequencerPanel.AbstractSequencer
-
start
public void start()- Specified by:
startin 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:RealtimeProcesses 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
-