org.rubato.rubettes.util
Class NoteGenerator

java.lang.Object
  extended by org.rubato.rubettes.util.NoteGenerator
Direct Known Subclasses:
MacroNoteGenerator, SoundNoteGenerator

public abstract class NoteGenerator
extends java.lang.Object

A utility class for generating Note and Score denotators with ease. The following possibilities are provided for parallel use: - melody generation from a pitch list - iterative melody generation - single note generation

Author:
Florian Thalmann

Constructor Summary
NoteGenerator()
           
 
Method Summary
 void addNoteToMelody(double pitch)
          Adds a note with the specified pitch to the iterative melody.
abstract  Denotator convertScore(Denotator input)
           
 LimitDenotator copyAndSetLayer(LimitDenotator note, int layerIndex)
           
 LimitDenotator createAbsoluteNote(LimitDenotator note, LimitDenotator referenceNote)
           
abstract  PowerDenotator createEmptyScore()
           
 LimitDenotator createNodeDenotator(Denotator note)
           
 LimitDenotator createNodeDenotator(Denotator note, Denotator macroScore)
           
 LimitDenotator createNodeDenotator(double[] noteValues)
           
 LimitDenotator createNodeDenotators(Denotator note, Denotator macroScore)
           
 LimitDenotator createNoteDenotator(double[] values)
          Returns a new Note denotator with the specified parameters.
 LimitDenotator createNoteDenotator(double onset, double pitch, int loudness, double duration, int voice)
          Returns a new Note denotator with the specified parameters.
 PowerDenotator createScoreWithMelody()
          Returns the current iteratively generated melody.
 PowerDenotator createSimpleMelody(double noteDistance, double... pitches)
          Returns a Score denotator containing a note for every specified pitch.
 PowerDenotator createSimpleMelody(double noteDistance, java.lang.Double[] pitches)
          Returns a Score denotator containing a note for every specified pitch.
 java.lang.Double getDoubleValue(Denotator note, int[] elementPath)
           
 SimpleForm getDurationForm()
          Returns the Duration form from the system repository.
 int getLayer(LimitDenotator node)
           
 SimpleForm getLoudnessForm()
          Returns the Loudness form from the system repository.
 SimpleForm getOnsetForm()
          Returns the Onset form from the system repository.
 SimpleForm getPitchForm()
          Returns the Pitch form from the system repository.
 PowerForm getScoreForm()
          Returns the Score form from the system repository.
 LimitDenotator makeNoteAbsolute(LimitDenotator note, LimitDenotator referenceNote)
           
 LimitDenotator makeNoteRelative(LimitDenotator note, LimitDenotator referenceNote)
           
 void modifyNoteDenotator(LimitDenotator note, double onset, double duration)
          Modifies the elements of the coordinates of a note denotator with the specified new values.
 void modifyNoteDenotator(LimitDenotator note, double onset, int loudness, double duration)
          Modifies the elements of the coordinates of a note denotator with the specified new values.
 void modifyNoteDenotator(LimitDenotator note, int[] elementPath, double value)
           
 void startNewMelody(double noteDistance)
          Starts a new iterative melody with the specified note distance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoteGenerator

public NoteGenerator()
Method Detail

convertScore

public abstract Denotator convertScore(Denotator input)

createEmptyScore

public abstract PowerDenotator createEmptyScore()

createSimpleMelody

public PowerDenotator createSimpleMelody(double noteDistance,
                                         java.lang.Double[] pitches)
Returns a Score denotator containing a note for every specified pitch. The first note has onset 0.

Parameters:
noteDistance - - the distance between subsequent notes
pitches - - an array of pitch values

createSimpleMelody

public PowerDenotator createSimpleMelody(double noteDistance,
                                         double... pitches)
Returns a Score denotator containing a note for every specified pitch. The first note has onset 0.

Parameters:
noteDistance - - the distance between subsequent notes
pitches - - the pitch values

startNewMelody

public void startNewMelody(double noteDistance)
Starts a new iterative melody with the specified note distance.

Parameters:
noteDistance - - the distance between subsequent notes

addNoteToMelody

public void addNoteToMelody(double pitch)
Adds a note with the specified pitch to the iterative melody.

Parameters:
pitch - - the pitch of the new note

createScoreWithMelody

public PowerDenotator createScoreWithMelody()
Returns the current iteratively generated melody.


createNoteDenotator

public LimitDenotator createNoteDenotator(double[] values)
Returns a new Note denotator with the specified parameters.

Parameters:
values -

createNoteDenotator

public LimitDenotator createNoteDenotator(double onset,
                                          double pitch,
                                          int loudness,
                                          double duration,
                                          int voice)
Returns a new Note denotator with the specified parameters.

Parameters:
onset -
pitch -
loudness -
duration -

makeNoteRelative

public LimitDenotator makeNoteRelative(LimitDenotator note,
                                       LimitDenotator referenceNote)

makeNoteAbsolute

public LimitDenotator makeNoteAbsolute(LimitDenotator note,
                                       LimitDenotator referenceNote)

createAbsoluteNote

public LimitDenotator createAbsoluteNote(LimitDenotator note,
                                         LimitDenotator referenceNote)

createNodeDenotator

public LimitDenotator createNodeDenotator(double[] noteValues)

createNodeDenotators

public LimitDenotator createNodeDenotators(Denotator note,
                                           Denotator macroScore)

createNodeDenotator

public LimitDenotator createNodeDenotator(Denotator note)

createNodeDenotator

public LimitDenotator createNodeDenotator(Denotator note,
                                          Denotator macroScore)

copyAndSetLayer

public LimitDenotator copyAndSetLayer(LimitDenotator note,
                                      int layerIndex)

getLayer

public int getLayer(LimitDenotator node)

modifyNoteDenotator

public void modifyNoteDenotator(LimitDenotator note,
                                double onset,
                                int loudness,
                                double duration)
                         throws RubatoException
Modifies the elements of the coordinates of a note denotator with the specified new values.

Parameters:
note - - the note, the values of which have to be replaced
onset - - the new onset
loudness - - the new loudness
duration - - the new duration
Throws:
RubatoException

modifyNoteDenotator

public void modifyNoteDenotator(LimitDenotator note,
                                double onset,
                                double duration)
                         throws RubatoException
Modifies the elements of the coordinates of a note denotator with the specified new values.

Parameters:
note - - the note, the values of which have to be replaced
onset - - the new onset
duration - - the new duration
Throws:
RubatoException

modifyNoteDenotator

public void modifyNoteDenotator(LimitDenotator note,
                                int[] elementPath,
                                double value)

getDoubleValue

public java.lang.Double getDoubleValue(Denotator note,
                                       int[] elementPath)

getScoreForm

public PowerForm getScoreForm()
Returns the Score form from the system repository.


getOnsetForm

public SimpleForm getOnsetForm()
Returns the Onset form from the system repository.


getPitchForm

public SimpleForm getPitchForm()
Returns the Pitch form from the system repository.


getLoudnessForm

public SimpleForm getLoudnessForm()
Returns the Loudness form from the system repository.


getDurationForm

public SimpleForm getDurationForm()
Returns the Duration form from the system repository.