Class RunningOctaveCollector<P extends PitchModOctave & Comparable<P>>

java.lang.Object
eu.bandm.music.entities.RunningOctaveCollector<P>
Type Parameters:
P - the type of the pitch classes.

public class RunningOctaveCollector<P extends PitchModOctave & Comparable<P>> extends Object
Collects and distributes the octave information over a sequence of incomplete pitch information. "Running octave" is a principle for the convenience of noatation, well proven in musictex, musixtex, lilypond etc. It means that partial information which gives only a pitch class means the concrete pitch with the minimal distance to its predecessor. Ergo only functional intervals up to a fourth are generated in this case.

For its definition/realization, it requires a notion of "nearest" pitch w.r.t a particular pitch of the predecessor and a particular pitchModOctave. The CWN convention, as implemened here, requires that there are "WhiteKeys" as the basis for notation, and "nearest" is defined on these.

The input grammar accepted by this pre-processor is

  pitch ::=      (octUp | octDown)? pitchModOctave
             |   pitchModOctave octaveRegister
 
Usage: Create an instance, apply the Translet.Parser resturned by parser(), and finally call reify(MessageReceiver,Iterable,Map).