c11files.calgorythmic.lab
Class Chord

java.lang.Object
  extended by c11files.calgorythmic.lab.Chord

public class Chord
extends java.lang.Object

Chord models a single chord in a Part of a Piece of music. This implementation only supports single notes rather than multiple-note chords.

Version:
27nov2009
Author:
kvlinden

Constructor Summary
Chord(int pitch, int duration)
          Construct a new Chord
 
Method Summary
 int getDuration()
           
 java.util.List<Event> getEvents(int type)
           
 int getPitch()
           
 java.util.ArrayList<Beat> getWaitBeats()
           
 void setPitch(int pitch)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chord

public Chord(int pitch,
             int duration)
      throws java.lang.Exception
Construct a new Chord

Parameters:
pitch - a specified pitch
duration - a specified duration
Throws:
java.lang.Exception
Method Detail

getPitch

public int getPitch()

setPitch

public void setPitch(int pitch)
              throws java.lang.Exception
Throws:
java.lang.Exception

getDuration

public int getDuration()

getEvents

public java.util.List<Event> getEvents(int type)
Parameters:
type - a specified event type (cf. Midi)
Returns:
a list of events of the given event type for each pitch

getWaitBeats

public java.util.ArrayList<Beat> getWaitBeats()
Returns:
an ArrayList of pitch-less beats with the length specified by the chord's duration