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

java.lang.Objectjmqt.QTUtil
- All Implemented Interfaces:
- jm.constants.Alignments, jm.constants.DrumMap, jm.constants.Durations, jm.constants.Dynamics, 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 class QTUtil
- extends java.lang.Object
- implements jm.JMC
- extends java.lang.Object
A class which plays a jMusic score via Apple's QuickTime. Requires the QTJava classes from Apple Computer inc. Based on example code and help from Bill Stewart (thanks Bill).
| Field Summary | |
private NoteChannel[] |
nc1
|
private jm.music.data.Score |
score
|
private double |
speed
|
private ToneDescription |
td
|
private double |
tempoMultiplier
|
private MusicData |
tune1
|
private TunePlayer |
tunePlayer1
|
private boolean |
usingTuneOne
|
| 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 | |
QTUtil()
|
|
QTUtil(jm.music.data.Score s)
|
|
| Method Summary | |
private MusicData |
convertFromScore(jm.music.data.Score score,
double[][] noteOrder,
int qt_sequence_length)
|
void |
finalize()
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. |
jm.music.data.Score |
getScore()
|
double |
getSpeed()
return the current speed, which changes with the score tempo |
void |
playback(jm.music.data.Score s)
|
void |
playOneNote(jm.music.data.Note note,
int channel)
Play a single note via QuickTime |
private void |
quickSort(double[][] noteOrder,
int left,
int right)
|
void |
replay()
Play the current score again. |
void |
sendMIDIControlChange(int channel,
int controllerNumber,
int value)
Send a MIDI control change message immediately Note: this method is at the mercy of QuickTime and may not work when QT is set to the internal QT musical instruments sound synthesizer. |
void |
sendMIDIMessage(int status,
int channel,
int[] dataByteArray)
Send any MIDI channel message immediately |
private void |
setGMInstruments()
|
void |
setNoteInstrument()
Choose a general MIDI sound for playback of single notes |
void |
setScore(jm.music.data.Score score)
|
void |
setSpeed(double speed)
return the current speed, which changes with the score tempo. |
private void |
setUp()
|
private void |
setupNoteChannels()
|
private double[][] |
sortNotes(jm.music.data.Score score,
int totalNotes)
|
void |
stopPlayback()
Halt the current score playabck. |
(package private) static void |
swap(double[][] noteOrder,
int i,
int j)
|
private int |
totalNotesInScore()
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
tunePlayer1
private TunePlayer tunePlayer1
tune1
private MusicData tune1
usingTuneOne
private boolean usingTuneOne
score
private jm.music.data.Score score
nc1
private NoteChannel[] nc1
speed
private double speed
td
private ToneDescription td
tempoMultiplier
private double tempoMultiplier
| Constructor Detail |
QTUtil
public QTUtil()
QTUtil
public QTUtil(jm.music.data.Score s)
| Method Detail |
setScore
public void setScore(jm.music.data.Score score)
getScore
public jm.music.data.Score getScore()
setUp
private void setUp()
throws QTException
setupNoteChannels
private void setupNoteChannels()
throws QTException
setGMInstruments
private void setGMInstruments()
throws StdQTException
totalNotesInScore
private int totalNotesInScore()
sortNotes
private double[][] sortNotes(jm.music.data.Score score, int totalNotes)
quickSort
private void quickSort(double[][] noteOrder,
int left,
int right)
swap
static void swap(double[][] noteOrder,
int i,
int j)
convertFromScore
private MusicData convertFromScore(jm.music.data.Score score, double[][] noteOrder, int qt_sequence_length) throws QTException
playback
public void playback(jm.music.data.Score s)
replay
public void replay()
- Play the current score again.
stopPlayback
public void stopPlayback()
- Halt the current score playabck.
getSpeed
public double getSpeed()
- return the current speed, which changes with the score tempo
setSpeed
public void setSpeed(double speed)
- return the current speed, which changes with the score tempo.
playOneNote
public void playOneNote(jm.music.data.Note note, int channel)
- Play a single note via QuickTime
sendMIDIControlChange
public void sendMIDIControlChange(int channel,
int controllerNumber,
int value)
- Send a MIDI control change message immediately
Note: this method is at the mercy of QuickTime and may not work when QT is set to
the internal QT musical instruments sound synthesizer. It does work when sending to
external MIDI devices. QuickTime may also not support external MIDI devices on some
implementations, for example Mac OS X 10.0. In these cases a standard QT exception
will be printed to he command line.
sendMIDIMessage
public void sendMIDIMessage(int status,
int channel,
int[] dataByteArray)
- Send any MIDI channel message immediately
setNoteInstrument
public void setNoteInstrument()
- Choose a general MIDI sound for playback of single notes
finalize
public void finalize()
- Description copied from class:
java.lang.Object - Called on an object by the Virtual Machine at most once,
at some point after the Object is determined unreachable
but before it is destroyed. You would think that this
means it eventually is called on every Object, but this is
not necessarily the case. If execution terminates
abnormally, garbage collection does not always happen.
Thus you cannot rely on this method to always work.
For finer control over garbage collection, use references
from the
java.lang.refpackage.Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply
super.finalize().finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.
If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.
It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.
Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls
super.finalize().The default implementation does nothing.
|
|||||||||
| Home >> All >> [ jmqt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
jmqt.QTUtil