|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object micromod.InstrumentPlayer
InstrumentPlayer 0.5 This class is designed to play a ProTracker style instrument at the specified pitch The output of an object of this class has any instrument-related effects applied. This class supports resamplers with "cushion" sizes up to 16 points.
Field Summary | |
protected static int |
CUSHION_BUFFER_SAMPLES
|
protected short[] |
cushionBuffer
|
protected static int |
FIXED_POINT_BITMASK
|
static int |
FIXED_POINT_SHIFT
|
protected LoopDecoder |
loopDecoder
|
protected static int |
RESAMPLE_BUFFER_SAMPLES
|
protected short[] |
resampleBuffer
|
protected int |
resampleFactor
|
protected int |
subSamplePos
|
Constructor Summary | |
InstrumentPlayer()
|
Method Summary | |
void |
assignInstrument(Instrument i)
Assign an Instrument to be played. |
protected void |
blankCushionBuffer()
Zero the contents of the cushion buffer. |
void |
getAudio(short[] buffer,
int length,
Resampler resampler,
boolean snapBack)
Get the required amount of audio for resampling, and resample it into the specified buffer. |
Instrument |
getInstrument()
Get the current instrument |
int |
getSamplePosition()
|
protected int |
getSamplesRequired(int length)
|
boolean |
hasFinished()
|
void |
setAssigned()
|
void |
setResampleFactor(int resampleFactor)
Set the number of input samples per output sample produced in the getAudio() method. |
void |
setSamplePosition(int samplePosition)
Explicitly set the sample position of playback. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FIXED_POINT_SHIFT
protected static final int FIXED_POINT_BITMASK
protected static final int CUSHION_BUFFER_SAMPLES
protected static final int RESAMPLE_BUFFER_SAMPLES
protected int resampleFactor
protected int subSamplePos
protected short[] resampleBuffer
protected short[] cushionBuffer
protected LoopDecoder loopDecoder
Constructor Detail |
public InstrumentPlayer()
Method Detail |
public void assignInstrument(Instrument i)
public void setAssigned()
public Instrument getInstrument()
public void setSamplePosition(int samplePosition)
public int getSamplePosition()
public boolean hasFinished()
public void setResampleFactor(int resampleFactor)
public void getAudio(short[] buffer, int length, Resampler resampler, boolean snapBack)
protected int getSamplesRequired(int length)
protected void blankCushionBuffer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |