public abstract class AbstractLFO extends Object implements LFO
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isConfigured
True if one of the set...Speed() methods has been called.
|
protected long |
randomSeed
The random seed.
|
protected SongContext |
songContext
The song context.
|
protected static double |
TWO_PI
Two times Pi.
|
| Constructor and Description |
|---|
AbstractLFO() |
| Modifier and Type | Method and Description |
|---|---|
long |
getRandomSeed()
Returns the current random seed, which is the last seed set by setRandomSeed() or the initial random seed if setRandomSeed() hasn't been called
before.
|
double |
getRawTickValue(int tick)
Returns the LFO's raw value (between 0 and 1) at the given tick, without any scaling or cut-off.
|
int |
getTickValue(int tick)
Returns the LFO's value at the given tick as an integer, taking scaling (via minAmplitude and maxAmplitude) and cut-off (via minValue and
maxValue) into account.
|
protected abstract double |
getValue(double angle)
Returns the LFO's value of the given angle as a double.
|
void |
setActivitySpeed(double rotationsPerActivity,
int startTick,
int endTick)
Makes this LFO synchronized to a tick range and sets the parameters.
|
void |
setBeatSpeed(double rotationsPerBeat,
int ticksPerBeat)
Makes this LFO synchronized to beats and sets the parameters.
|
void |
setMaxAmplitude(int maxAmplitude)
Sets the maximum value of the amplitude.
|
void |
setMaxValue(int maxValue)
Sets the maximum value to return.
|
void |
setMinAmplitude(int minAmplitude)
Sets the minimum value of the amplitude.
|
void |
setMinValue(int minValue)
Sets the minimum value to return.
|
void |
setPhase(double phase)
Set the starting phase (the phase to use for tick 0).
|
void |
setRandomSeed(long randomSeed)
Sets the random seed to use.
|
void |
setSegmentPairSpeed(double rotationsPerSegmentPair,
ActivityVector activityVector)
Makes this LFO synchronized to an ActivityVector's activity and pause segments.
|
void |
setSongContext(SongContext songContext)
Sets the song context.
|
void |
setSongSpeed(double rotationsPerSong,
int ticksPerSong)
Makes this LFO synchronized to the song length and sets the parameters.
|
void |
setTimeSpeed(double rotationsPerSecond,
int ticksPerBeat,
double bpm)
Makes this LFO synchronized to time and sets the parameters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfigureprotected static final double TWO_PI
protected SongContext songContext
protected long randomSeed
protected boolean isConfigured
protected abstract double getValue(double angle)
angle - the angle in radians (non-negative)public int getTickValue(int tick)
LFOgetTickValue in interface LFOtick - the tick (non-negative)public double getRawTickValue(int tick)
LFOgetRawTickValue in interface LFOtick - the tick (non-negative)public void setBeatSpeed(double rotationsPerBeat,
int ticksPerBeat)
LFOsetBeatSpeed in interface LFOrotationsPerBeat - the number of rotations per beatticksPerBeat - the number of ticks per beatpublic void setSongSpeed(double rotationsPerSong,
int ticksPerSong)
LFOsetSongSpeed in interface LFOrotationsPerSong - the number of rotations for the whole songticksPerSong - the ticks of the songpublic void setActivitySpeed(double rotationsPerActivity,
int startTick,
int endTick)
LFOsetActivitySpeed in interface LFOrotationsPerActivity - the number of rotations for the tick rangestartTick - the start tickendTick - the end tickpublic void setTimeSpeed(double rotationsPerSecond,
int ticksPerBeat,
double bpm)
LFOsetTimeSpeed in interface LFOrotationsPerSecond - the number of rotations per secondticksPerBeat - the ticks per beatbpm - the BPMpublic void setSegmentPairSpeed(double rotationsPerSegmentPair,
ActivityVector activityVector)
LFOsetSegmentPairSpeed in interface LFOrotationsPerSegmentPair - the number of rotations per segment pairactivityVector - the activity vectorpublic void setPhase(double phase)
LFOpublic void setMinValue(int minValue)
LFOsetMinValue in interface LFOminValue - the value minimumpublic void setMaxValue(int maxValue)
LFOsetMaxValue in interface LFOmaxValue - the value maximumpublic void setMinAmplitude(int minAmplitude)
LFOsetMinAmplitude in interface LFOminAmplitude - the minimum amplitude valuepublic void setMaxAmplitude(int maxAmplitude)
LFOsetMaxAmplitude in interface LFOmaxAmplitude - the maximum amplitude valuepublic void setRandomSeed(long randomSeed)
RandomSeedablesetRandomSeed in interface RandomSeedablerandomSeed - the random seedpublic long getRandomSeed()
RandomSeedablegetRandomSeed in interface RandomSeedablepublic void setSongContext(SongContext songContext)
LFOsetSongContext in interface LFOsongContext - the song context