auditory.described
Class Score

java.lang.Object
  extended by auditory.described.Score

public class Score
extends java.lang.Object

An encapsulation of a music score

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
Score()
          Default Constructor
 
Method Summary
 void addPart(Part part, java.lang.String instrument)
          Add a Part to this Score
 java.lang.String getInstrumentName(Part part)
          Get a String representation of the instrument for a particular Part
 java.util.Enumeration<Part> getParts()
          Get the Part objects in this Score
 void removePart(Part part)
          Remove a Part from this Score
 void render()
          Render this Score
 void setChannel(Part part, javax.sound.midi.MidiChannel channel)
          Set the MidiChannel associated with a Part
 void setTempo(int millisPerMeasure)
          Set the tempo for this Part
 void setTimeSignature(int numerator, int denominator)
          Set the time signature for this Part
 void upbeat(Metronome metronome)
          Handle an upbeat message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Score

public Score()
Default Constructor

Method Detail

addPart

public void addPart(Part part,
                    java.lang.String instrument)
Add a Part to this Score

Parameters:
part - The Part to add

getParts

public java.util.Enumeration<Part> getParts()
Get the Part objects in this Score

Returns:
An Enumeration of the Part objects in this Score

getInstrumentName

public java.lang.String getInstrumentName(Part part)
Get a String representation of the instrument for a particular Part

Parameters:
part - The Part of interest
Returns:
The name of the instrument

removePart

public void removePart(Part part)
Remove a Part from this Score

Parameters:
part - The Part to remove

render

public void render()
Render this Score


setChannel

public void setChannel(Part part,
                       javax.sound.midi.MidiChannel channel)
Set the MidiChannel associated with a Part

Parameters:
part - The Part
channel - The MidiChannel for that Part

setTempo

public void setTempo(int millisPerMeasure)
Set the tempo for this Part

Parameters:
millisPerMeasure - The tempo (in milliseconds per measure)

setTimeSignature

public void setTimeSignature(int numerator,
                             int denominator)
Set the time signature for this Part

Parameters:
numerator - The numerator of the time signature
denominator - The denominator of the time signature

upbeat

public void upbeat(Metronome metronome)
Handle an upbeat message

Parameters:
metronome - The Metronome that the Part objects listen to


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers