Package com.softsynth.jmsl
Interface SequenceGenerator
- All Known Implementing Classes:
HailstoneSequence,Oof,RandomSequence,RandomWalkSequence,SequencerGeneratorAdapter,WeightedIntegerSequence
public interface SequenceGenerator
Define the interface for SequenceGenerator objects for JMSL.
Objects implementing this interface can be used to generate sequences
for algorithmic composition.
- Author:
- Phil Burk and Nick Didkovsky
- See Also:
SequencerGeneratorAdapter
-
Method Summary
Modifier and Type Method Description intgetNext()intgetSeed()intnext()Return next value in sequence, then generate a new one.voidrandomize()Set seed from system time.voidreset()Reset sequence generator so that it will restart at seed value.voidsetNext(int next)Set next value in sequence.voidsetSeed(int seed)Set pseudo-random generator seed for repeatable sequences.
-
Method Details
-
next
int next()Return next value in sequence, then generate a new one. -
getNext
int getNext()- Returns:
- next value in sequence. Does not advance state.
-
setNext
void setNext(int next)Set next value in sequence. -
setSeed
void setSeed(int seed)Set pseudo-random generator seed for repeatable sequences. May be ignored if the same sequence is always generated. -
getSeed
int getSeed()- Returns:
- seed set by setSeed.
-
randomize
void randomize()Set seed from system time. This will result in a unique sequence each time it is called. -
reset
void reset()Reset sequence generator so that it will restart at seed value.
-