jcaas.midi
Class GeneratedStaffOct

java.lang.Object
  extended by jcaas.midi.GeneratedStaff
      extended by jcaas.midi.GeneratedStaffOct
All Implemented Interfaces:
Staff

public class GeneratedStaffOct
extends GeneratedStaff


Constructor Summary
GeneratedStaffOct(NoteVector seedNote, java.lang.String[] propertyList, java.lang.Object[] properties)
          Constructor
 
Method Summary
 StaffProperty getCurrentProperty(java.lang.String propertyName)
          Returns the current value for a given property in a Staff.
 StaffProperty getDefaultProperty(java.lang.String propertyName)
          Returns the default value for a given property in a Staff.
 NoteVector getNextNote()
          getNextNote returns the next NoteVector in the sqeuence of the Staff.
 void reset()
          Resets all current values for Staff properties to their default values and resets the note-position to the first note.
 void resetProperty(java.lang.String propertyName)
          Resets the current value for a given property in a Staff to its default value.
 void setProperty(java.lang.String propertyName, StaffProperty p)
          Sets the current value for a given property in a Staff.
 void setRand(double num, double gauss)
          A method to load the next set of random values into this class
 void useGenScore(GeneratedScore gs)
          A method for sychronizing with a Generated Score so the same random values are used for all the score's generated staves.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedStaffOct

public GeneratedStaffOct(NoteVector seedNote,
                         java.lang.String[] propertyList,
                         java.lang.Object[] properties)
                  throws java.lang.Exception
Constructor

Parameters:
seedNote - the note to begin generating music with
propertyList - a string array holding the list of the names of properties defined for this Staff. Notes and Tempo are the only required properties.
properties - an object array holding the properities of this Staff in the order provided by propertyList.
Throws:
java.lang.Exception - indicating failed constructor.
Method Detail

getNextNote

public NoteVector getNextNote()
Description copied from interface: Staff
getNextNote returns the next NoteVector in the sqeuence of the Staff. The behavior is such that when the end of the song is reached, the song will loop.

Specified by:
getNextNote in interface Staff
Overrides:
getNextNote in class GeneratedStaff
Returns:
the next NoteVector to be played.

getDefaultProperty

public StaffProperty getDefaultProperty(java.lang.String propertyName)
Description copied from interface: Staff
Returns the default value for a given property in a Staff. Valid properties are names of classes that extend StaffProperty.

Specified by:
getDefaultProperty in interface Staff
Overrides:
getDefaultProperty in class GeneratedStaff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
Returns:
the StaffProperty, which will be a class of type propertyName that is defualt for this song. null if this property is not implemented.

getCurrentProperty

public StaffProperty getCurrentProperty(java.lang.String propertyName)
Description copied from interface: Staff
Returns the current value for a given property in a Staff. Valid properties are names of classes that extend StaffProperty.

Specified by:
getCurrentProperty in interface Staff
Overrides:
getCurrentProperty in class GeneratedStaff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
Returns:
the StaffProperty, which will be a class of type propertyName that is current for this song. null if this property is not implemented.

setProperty

public void setProperty(java.lang.String propertyName,
                        StaffProperty p)
Description copied from interface: Staff
Sets the current value for a given property in a Staff. Valid properties are names of classes that extend StaffProperty.

Specified by:
setProperty in interface Staff
Overrides:
setProperty in class GeneratedStaff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.
p - - the StaffProperty, which must be a class of type propertyName that is current for this song. null if this property is not implemented.

resetProperty

public void resetProperty(java.lang.String propertyName)
Description copied from interface: Staff
Resets the current value for a given property in a Staff to its default value. Valid properties are names of classes that extend StaffProperty.

Specified by:
resetProperty in interface Staff
Overrides:
resetProperty in class GeneratedStaff
Parameters:
propertyName - - a String holding the name of the property, which is the name of the class that extends StaffProperty that represents this property.

reset

public void reset()
Description copied from interface: Staff
Resets all current values for Staff properties to their default values and resets the note-position to the first note. Valid properties are names of classes that extend StaffProperty.

Specified by:
reset in interface Staff
Overrides:
reset in class GeneratedStaff

useGenScore

public void useGenScore(GeneratedScore gs)
A method for sychronizing with a Generated Score so the same random values are used for all the score's generated staves.

Overrides:
useGenScore in class GeneratedStaff
Parameters:
gs - the score this staff is a part of.

setRand

public void setRand(double num,
                    double gauss)
A method to load the next set of random values into this class

Overrides:
setRand in class GeneratedStaff
Parameters:
num - the next random number to use
gauss - the next random gaussian to use