public class Part extends java.lang.Object implements MetronomeListener
Note: This class is not thread safe. Hence, Part objects should be modified as required before they are rendered.
| Constructor and Description |
|---|
Part()
Default Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Content c)
Add a Content to this Part
|
void |
handleTick(int millis)
Handle a Metronome tick
(required by MetronomeListener).
|
void |
render(javax.sound.midi.MidiChannel channel)
Render the current note in this Part
|
void |
setTempo(int millisPerMeasure)
Set the tempo for this Part
|
void |
setTimeSignature(int numerator,
int denominator)
Set the time signature for this Part
|
void |
upbeat(Metronome metronome)
Alert this Part to the fact that is should
make itself ready to be played
|
public void add(Content c)
c - The Content to addpublic void handleTick(int millis)
handleTick in interface MetronomeListenermillis - The number of milliseconds since the startpublic void render(javax.sound.midi.MidiChannel channel)
channel - The MidiChannel to usepublic void setTempo(int millisPerMeasure)
millisPerMeasure - The tempo (in milliseconds per measure)public void setTimeSignature(int numerator,
int denominator)
numerator - The numerator of the time signaturedenominator - The denominator of the time signaturepublic void upbeat(Metronome metronome)
metronome - The Metronome it will listen to