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
 int getNext()
           
 int getSeed()
           
 int next()
          Return next value in sequence, then generate a new one.
 void randomize()
          Set seed from system time.
 void reset()
          Reset sequence generator so that it will restart at seed value.
 void setNext(int next)
          Set next value in sequence.
 void setSeed(int seed)
          Set pseudo-random generator seed for repeatable sequences.
 

Method Detail

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.