public class Chord
extends java.lang.Object
MusicSpecs
.Constructor and Description |
---|
Chord()
Construct an empty Chord with no chord tones.
|
Chord(java.util.Set<Note> chordTones)
Construct a chord by a set of note objects.
|
Chord(java.lang.String name,
double duration)
Construct a chord with a name and a duration.
|
Modifier and Type | Method and Description |
---|---|
void |
addNote(Note n)
Add a note to this chord.
|
double |
getDuration()
Get the duration of this Chord.
|
java.lang.String |
getName()
Get name of this Chord.
|
java.util.Set<Note> |
getNotes()
Get notes contained by this Chord.
|
void |
setChordTones()
Set the notes contained by this chord by a dictionary lookup.
|
void |
setChordTones(java.lang.String chord)
Set the notes contained by this chord, by name reference.
|
public Chord(java.lang.String name, double duration)
name
- Chord nameduration
- Chord durationpublic Chord(java.util.Set<Note> chordTones)
chordTones
- a Set of notes that are a part of the specified Chord.public Chord()
public void addNote(Note n)
n
- Note to be addedpublic java.util.Set<Note> getNotes()
public double getDuration()
public java.lang.String getName()
public void setChordTones() throws IllegalActionException
IllegalActionException
- If the chord name is undefined.public void setChordTones(java.lang.String chord)
chord
- The chord name