|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.org.toot.music.performance.Performer
public class Performer
A Performer performs on an Instrument. It can swing (eigth note) timing. Currently it can only render to a MIDI file, not perform live.
Constructor Summary | |
---|---|
Performer(java.lang.String name,
Instrument instrument)
|
Method Summary | |
---|---|
Instrument |
getInstrument()
|
java.lang.String |
getName()
|
float |
getSwingRatio()
|
void |
renderBar(int[] notes,
javax.sound.midi.Track track,
long startTick,
int ppqn)
Render a bar of notes as MIDI to the specified Track from the specified start tick with the specified ticks per bar. |
void |
setInstrument(Instrument instrument)
|
void |
setSwingRatio(float ratio)
Set the ratio of the first eigth note to the second eigth note when a quarter note is divied into two with a swing or shuffle rhythm |
float |
swing(int time)
Swing the timing of a sixty-fourth note timing such that when a quarter note is divided into two the second eigth note is delayed relative to its nominal position and all other sixty-fourth note timings are smoothly varied accordingly. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Performer(java.lang.String name, Instrument instrument)
Method Detail |
---|
public java.lang.String getName()
public void renderBar(int[] notes, javax.sound.midi.Track track, long startTick, int ppqn) throws javax.sound.midi.InvalidMidiDataException
notes
- the notes to rendertrack
- the MIDI Track to render tostartTick
- the tick at the start of the barticksPerBar
- the number of ticks per bar
javax.sound.midi.InvalidMidiDataException
public float getSwingRatio()
public void setSwingRatio(float ratio)
ratio
- the ratio of the first eigth note to the second eigth notepublic float swing(int time)
time
- the timing index of a sixty-fourth note in a bar
public Instrument getInstrument()
public void setInstrument(Instrument instrument)
instrument
- the instrument to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |