world.sound.tunes
Class Tune

java.lang.Object
  extended by world.sound.tunes.Tune

public class Tune
extends java.lang.Object

Represents one a Chord to be played on the given channel. Based in part on a class originally designed by Viera K. Proulx.


Constructor Summary
Tune(int channel)
          Create an empty Tune on the given channel.
Tune(int channel, Chord chord)
          Create a Tune on the given channel from the given Chord.
Tune(int channel, Note... notes)
          Create a Tune on the given channel from the given Notes.
 
Method Summary
 void addChord(Chord c)
          Add all the Notes fomr the given Chord to this Tune.
 void addNote(Note note)
          Add the given Note to this Tune's Chord
 void addNote(java.lang.String note)
          Add a Note (represented by the given String) this Tune's Chord.
 void clearChord()
          Remove all Notes from this Tune.
 boolean containsNote(Note n)
          Does this tune contain the given Note?
 int getChannel()
          Get the Channel number the Chord will be played on.
 Chord getChord()
          Return the Chord that will be played.
 boolean isSilent()
          Has this Tune finished playing? Are all the Notes in the Chord done?
 void removeSilent()
          Remove all the silent Notes from this Tune.
 int size()
          Return the number of Notes in this Tune
 java.lang.String toString()
          Produce a human readable representation of this Tune/Chord.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tune

public Tune(int channel,
            Chord chord)
Create a Tune on the given channel from the given Chord.


Tune

public Tune(int channel)
Create an empty Tune on the given channel.


Tune

public Tune(int channel,
            Note... notes)
Create a Tune on the given channel from the given Notes.

Method Detail

getChannel

public int getChannel()
Get the Channel number the Chord will be played on.


getChord

public Chord getChord()
Return the Chord that will be played.


addNote

public void addNote(Note note)
Add the given Note to this Tune's Chord


addNote

public void addNote(java.lang.String note)
Add a Note (represented by the given String) this Tune's Chord.


addChord

public void addChord(Chord c)
Add all the Notes fomr the given Chord to this Tune.


toString

public java.lang.String toString()
Produce a human readable representation of this Tune/Chord.

Overrides:
toString in class java.lang.Object

isSilent

public boolean isSilent()
Has this Tune finished playing? Are all the Notes in the Chord done?


removeSilent

public void removeSilent()
Remove all the silent Notes from this Tune.


clearChord

public void clearChord()
Remove all Notes from this Tune.


size

public int size()
Return the number of Notes in this Tune


containsNote

public boolean containsNote(Note n)
Does this tune contain the given Note?