|
|||||||||
| Home >> All >> [ qt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
qt
Class QTCycle

java.lang.Objectqt.QTCycle
- All Implemented Interfaces:
- java.awt.event.ActionListener, jm.constants.Alignments, javax.swing.event.ChangeListener, jm.constants.DrumMap, jm.constants.Durations, jm.constants.Dynamics, java.util.EventListener, jm.constants.Frequencies, jm.JMC, jm.constants.Noises, jm.constants.Panning, jm.constants.Pitches, jm.constants.ProgramChanges, jm.constants.RhythmValues, jm.constants.Scales, jm.constants.Tunings, jm.constants.Volumes, jm.constants.Waveforms
- public final class QTCycle
- extends java.lang.Object
- implements jm.JMC, javax.swing.event.ChangeListener, java.awt.event.ActionListener
- extends java.lang.Object
QuickTime Real Time playback for jMusic. * Score 1 is used first then score 2 and repeat infinitly. * While one score is playing the other score is updating. * Any class calling QTRT must implement two methods, * updateScore1() and updateScore2() * It is the responsibility of the calling app to * update the scores as required. Syncronisation of * this can be assisted by polling the value of the * score1PlayingFlag boolean variable. * A swing GUI is provided to adjust the scheduling * parameters as required. * The scoreLength argument is critical as it determines the * size of the scores created when updateScore methods * are called, which (of course) also changes the delay * between update calls. It can be changed using the * setScoreLength() method. * Remember to call the startPlayback() method (only once) or else * nothing will happen ;) Use suspendPlayback() and * resumePlayback() to interupt the playback once started. * * @param Score the first score object * @param Score the first score object * @param Object the class the calls this class * * @author Andrew Brown
| Field Summary | |
private int |
cycleCount
|
private javax.swing.JLabel |
gapNumber
|
private javax.swing.JSlider |
gapSlider
|
private java.lang.Thread |
myThread
|
private boolean |
newScoreFlag
|
private double |
nextTempo
|
private java.lang.Object |
obj
|
private QTUtil |
qtu1
|
private jm.music.data.Score |
score
|
private double |
scoreLength
|
private javax.swing.JLabel |
sleepNumber
|
private javax.swing.JSlider |
sleepSlider
|
private double |
sleepTime
|
private javax.swing.JButton |
startButton
|
private javax.swing.JButton |
stopButton
|
private double |
tempo
|
private javax.swing.JLabel |
tempoNumber
|
private javax.swing.JSlider |
tempoSlider
|
private double |
theGap
|
private double |
time
|
private double |
waitTime
|
| Fields inherited from interface jm.JMC |
AMPLITUDE, DEBUG, DYNAMIC, EIGHT_BIT, FREQUENCY, KEY_SIG_EVT, MONO, NO_DENOMINATOR, NO_INSTRUMENT, NO_KEY_QUALITY, NO_KEY_SIGNATURE, NO_NUMERATOR, OCTAPHONIC, PAN, PITCH, PROG_EVT, QUADRAPHONIC, RHYTHM, SIXTEEN_BIT, STEREO, TEMP_EVT, THIRTY_TWO_BIT, TIME_SIG_EVT, VERBOSE |
| Fields inherited from interface jm.constants.Durations |
C, CD, CDD, CROTCHET, CROTCHET_TRIPLET, CT, DC, DDC, DDEN, DDHN, DDM, DDQ, DDQN, DEMI_SEMI_QUAVER, DEMI_SEMI_QUAVER_TRIPLET, DEN, DHN, DM, DOTTED_CROTCHET, DOTTED_EIGHTH_NOTE, DOTTED_HALF_NOTE, DOTTED_MINIM, DOTTED_QUARTER_NOTE, DOTTED_QUAVER, DOTTED_SEMI_QUAVER, DOTTED_SIXTEENTH_NOTE, DOUBLE_DOTTED_CROTCHET, DOUBLE_DOTTED_EIGHTH_NOTE, DOUBLE_DOTTED_HALF_NOTE, DOUBLE_DOTTED_MINIM, DOUBLE_DOTTED_QUARTER_NOTE, DOUBLE_DOTTED_QUAVER, DQ, DQN, DSN, DSQ, DSQT, EIGHTH_NOTE, EIGHTH_NOTE_TRIPLET, EN, ENT, HALF_NOTE, HALF_NOTE_TRIPLET, HN, HNT, M, MD, MDD, MINIM, MINIM_TRIPLET, MT, Q, QD, QDD, QN, QNT, QT, QUARTER_NOTE, QUARTER_NOTE_TRIPLET, QUAVER, QUAVER_TRIPLET, SB, SEMI_QUAVER, SEMI_QUAVER_TRIPLET, SEMIBREVE, SIXTEENTH_NOTE, SIXTEENTH_NOTE_TRIPLET, SN, SNT, SQ, SQD, SQT, THIRTYSECOND_NOTE, THIRTYSECOND_NOTE_TRIPLET, TN, TNT, TSN, TSNT, WHOLE_NOTE, WN |
| Fields inherited from interface jm.constants.Frequencies |
FRQ |
| Fields inherited from interface jm.constants.Tunings |
EQUAL, JUST, MEAN, PYTHAGOREAN |
| Fields inherited from interface jm.constants.Volumes |
F, FF, FFF, FORTE, FORTISSIMO, MEZZO_FORTE, MEZZO_PIANO, MF, MP, P, PIANISSIMO, PP, PPP, SILENT |
| Fields inherited from interface jm.constants.Panning |
PAN_CENTER, PAN_CENTRE, PAN_LEFT, PAN_RIGHT |
| Fields inherited from interface jm.constants.DrumMap |
ACOUSTIC_BASS_DRUM, ACOUSTIC_SNARE, BASS_DRUM_1, CABASA, CHINESE_CYMBAL, CLAVES, CLOSED_HI_HAT, COWBELL, CRASH_CYMBAL_1, CRASH_CYMBAL_2, ELECTRIC_SNARE, HAND_CLAP, HI_BONGO, HI_MID_TOM, HI_WOOD_BLOCK, HIGH_AGOGO, HIGH_FLOOR_TOM, HIGH_TIMBALE, HIGH_TOM, LONG_GUIRO, LONG_WHISTLE, LOW_AGOGO, LOW_BONGO, LOW_CONGA, LOW_FLOOR_TOM, LOW_MID_TOM, LOW_TIMBALE, LOW_TOM, LOW_WOOD_BLOCK, MARACAS, MUTE_CUICA, MUTE_HI_CONGA, MUTE_TRIANGLE, OPEN_CUICA, OPEN_HI_CONGA, OPEN_HI_HAT, OPEN_TRIANGLE, PEDAL_HI_HAT, RIDE_BELL, RIDE_CYMBAL_1, RIDE_CYMBAL_2, SHORT_GUIRO, SHORT_WHISTLE, SIDE_STICK, SPLASH_CYMBAL, TAMBOURINE, VIBRASLAP |
| Fields inherited from interface jm.constants.Scales |
AEOLIAN_SCALE, BLUES_SCALE, CHROMATIC_SCALE, DIATONIC_MINOR_SCALE, DORIAN_SCALE, HARMONIC_MINOR_SCALE, INDIAN_SCALE, LYDIAN_SCALE, MAJOR_SCALE, MELODIC_MINOR_SCALE, MINOR_SCALE, MIXOLYDIAN_SCALE, NATURAL_MINOR_SCALE, PENTATONIC_SCALE, TURKISH_SCALE |
| Fields inherited from interface jm.constants.Waveforms |
COSINE_WAVE, PULSE_WAVE, SABERSAW_WAVE, SAWDOWN_WAVE, SAWTOOTH_WAVE, SINE_WAVE, SQUARE_WAVE, TRIANGLE_WAVE |
| Fields inherited from interface jm.constants.Noises |
BROWN_NOISE, FRACTAL_NOISE, SMOOTH_NOISE, STEP_NOISE, WHITE_NOISE |
| Fields inherited from interface jm.constants.Alignments |
AFTER, BEFORE, CENTER_ALIGN, CENTER_ON_END, CENTER_ON_START, CENTRE_ALIGN, CENTRE_ON_END, CENTRE_ON_START, END_ON_CENTER, END_ON_CENTRE, END_TOGETHER, START_ON_CENTER, START_ON_CENTRE, START_TOGETHER |
| Constructor Summary | |
QTCycle(jm.music.data.Score score)
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent ae)
This method is invoked when an action occurs. |
private void |
changeGap()
|
private void |
changeSleep()
|
private void |
changeTempo()
|
int |
getCycleCount()
Report the number of times the cycle method has been run. |
double |
getScoreLength()
Reports the current score length setting. |
double |
getSleepTime()
Report the current loop gap time. |
double |
getTempo()
Reports the current speed in beats per minute. |
double |
getTheGap()
Report the current loop gap time. |
private void |
playCycle()
Shedule score playback na d score updating when required. |
void |
resumePlayback()
If paused, restart playback. |
void |
setCycleCount(int newCount)
Specify the number ot count cycles from. |
void |
setNextTempo(double newTempo)
Specifies the speed in beats per minute. |
void |
setScore(jm.music.data.Score s)
Specifies the score to be played. |
void |
setScoreLength(double newLength)
Specifies the length of a score to be played. |
void |
setSleepTime(double newSleepTime)
Update the sleep time value.. |
void |
setTempo(double newTempo)
Specifies the speed in beats per minute. |
void |
setTheGap(double newGap)
Update the sleep time value.. |
void |
settings()
Open a GUI with sliders to adjust the scheduler loading. |
void |
startPlayback()
Begin the cycling playback of the scores. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Called by an object to notify the listener that the object's state has changed. |
void |
suspendPlayback()
Pause playback. |
void |
updateTempo()
Updates the current speed in beats per minute * based on a waiting tempo change. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
myThread
private java.lang.Thread myThread
qtu1
private QTUtil qtu1
obj
private java.lang.Object obj
score
private jm.music.data.Score score
tempo
private double tempo
nextTempo
private double nextTempo
scoreLength
private double scoreLength
time
private double time
waitTime
private double waitTime
sleepTime
private double sleepTime
theGap
private double theGap
tempoSlider
private javax.swing.JSlider tempoSlider
sleepSlider
private javax.swing.JSlider sleepSlider
gapSlider
private javax.swing.JSlider gapSlider
tempoNumber
private javax.swing.JLabel tempoNumber
sleepNumber
private javax.swing.JLabel sleepNumber
gapNumber
private javax.swing.JLabel gapNumber
startButton
private javax.swing.JButton startButton
stopButton
private javax.swing.JButton stopButton
newScoreFlag
private boolean newScoreFlag
cycleCount
private int cycleCount
| Constructor Detail |
QTCycle
public QTCycle(jm.music.data.Score score)
| Method Detail |
startPlayback
public void startPlayback()
- Begin the cycling playback of the scores.
playCycle
private void playCycle()
- Shedule score playback na d score updating when required.
setScoreLength
public void setScoreLength(double newLength)
- Specifies the length of a score to be played.
* Changes the interval between score update calls.
getScoreLength
public double getScoreLength()
- Reports the current score length setting.
setScore
public void setScore(jm.music.data.Score s)
- Specifies the score to be played.
setTempo
public void setTempo(double newTempo)
- Specifies the speed in beats per minute.
getTempo
public double getTempo()
- Reports the current speed in beats per minute.
setNextTempo
public void setNextTempo(double newTempo)
- Specifies the speed in beats per minute.
updateTempo
public void updateTempo()
- Updates the current speed in beats per minute
* based on a waiting tempo change.
* This prevents gaps or overlaps in the playback
* which can occur from the use of setTempo()
* which updates immediatly.
setCycleCount
public void setCycleCount(int newCount)
- Specify the number ot count cycles from.
getCycleCount
public int getCycleCount()
- Report the number of times the cycle method has been run.
* Useful for counting beats , bars, phrases or
* whatever the chunk passed to the QTRT.
resumePlayback
public void resumePlayback()
- If paused, restart playback.
suspendPlayback
public void suspendPlayback()
- Pause playback.
setSleepTime
public void setSleepTime(double newSleepTime)
- Update the sleep time value..
getSleepTime
public double getSleepTime()
- Report the current loop gap time.
setTheGap
public void setTheGap(double newGap)
- Update the sleep time value..
getTheGap
public double getTheGap()
- Report the current loop gap time.
settings
public void settings()
- Open a GUI with sliders to adjust the scheduler loading.
* Used to optimise the timing and efficiecy of the real time
* QuickTime playback.
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
- Description copied from interface:
javax.swing.event.ChangeListener - Called by an object to notify the listener that the object's state has
changed. The incoming
eventidentifies thesourceof the event, allowing the listener to differentiate when it is listening for changes in multiple sources.- Specified by:
stateChangedin interfacejavax.swing.event.ChangeListener
changeTempo
private void changeTempo()
changeSleep
private void changeSleep()
changeGap
private void changeGap()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Description copied from interface:
java.awt.event.ActionListener - This method is invoked when an action occurs.
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
|
|||||||||
| Home >> All >> [ qt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
qt.QTCycle