|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmusiccreator.Song
public class Song
Implements the Song class, which is the main product of the MusicCreator program. A Song object should not be produced directly, but by a SongFactory object. A song contains a Key, a TimeSignature, and a BeatArray.
| Method Summary | |
|---|---|
static Song |
createSong(TimeSignature ts,
int n,
DefinitionArray da)
Generates the song using a ChordArrayFactory |
Key |
getKey()
|
int |
getTempo()
Get the tempo of the song in beats per minute |
void |
outputToConsole()
Outputs the song beat array to the console. |
void |
outputToMidi(javax.sound.midi.Track track)
Outputs the song to the specified MIDI track |
void |
outputToMusicXml(java.io.PrintWriter out)
Outputs the song beat array to MusicXML. |
static void |
setKey(Key k)
|
void |
setKey(java.lang.String keyname)
Sets the key of the song |
void |
setTempo(int tempo)
Sets the tempo of the song, automatically correcting for time-signature. |
static void |
setTimeSignature(TimeSignature ts)
Set the time signature of the song as specified by ts |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setKey(java.lang.String keyname)
keyname - getName of key to put the song inpublic static void setKey(Key k)
public Key getKey()
public void outputToConsole()
public void outputToMusicXml(java.io.PrintWriter out)
outputToMusicXml in interface MusicXmlOutputableout - The file stream to write to
public static Song createSong(TimeSignature ts,
int n,
DefinitionArray da)
ts - Time-signature to use.n - Number of measures in the song.
public static void setTimeSignature(TimeSignature ts)
ts - public int getTempo()
public void setTempo(int tempo)
tempo - Tempo in beats per minute.public void outputToMidi(javax.sound.midi.Track track)
outputToMidi in interface MidiOutputabletrack -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||