|
|||||||||
| Home >> All >> jm >> music >> [ data overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
jm.music.data
Class Score

java.lang.Objectjm.music.data.Score
- All Implemented Interfaces:
- jm.constants.Alignments, java.lang.Cloneable, jm.constants.DrumMap, jm.constants.Durations, jm.constants.Dynamics, jm.constants.Frequencies, jm.JMC, jm.constants.Noises, jm.constants.Panning, jm.constants.Pitches, jm.constants.ProgramChanges, jm.constants.RhythmValues, jm.constants.Scales, java.io.Serializable, jm.constants.Tunings, jm.constants.Volumes, jm.constants.Waveforms
- public class Score
- extends java.lang.Object
- implements jm.JMC, java.lang.Cloneable, java.io.Serializable
- extends java.lang.Object
The Score class is used to hold score data. Score data includes is primarily made up of a vector of Part objects. Commonly score data is algorithmically generated or read from a standard MIDI file, but can also be read and saved to file using Java's object serialization. In this way a Score's data can be saved in a more native context. To find out how to read from and write to standard MIDI files or to use object serializationcheck out the jm.util.Read and km.util.Write classes.
- Version:
- 1.0,Sun Feb 25 18:43:33 2001
| Field Summary | |
static int |
DEFAULT_DENOMINATOR
|
static int |
DEFAULT_KEY_QUALITY
|
static int |
DEFAULT_KEY_SIGNATURE
|
static int |
DEFAULT_NUMERATOR
|
static double |
DEFAULT_TEMPO
|
static java.lang.String |
DEFAULT_TITLE
|
static int |
DEFAULT_VOLUME
|
private int |
denominator
the bottom number of the time signature |
private int |
keyQuality
0 = major, 1 = minor, others modes not specified |
private int |
keySignature
the number of accidentals this score negative numbers are Flats, positive numbers are Sharps |
private int |
numerator
the top number of the time signature |
private java.util.Vector |
partList
a Vector containing the Part objects associated with this score |
private double |
tempo
the speed for this score |
private java.lang.String |
title
the name assigned to a Score |
private int |
volume
the loudness for this score |
| Fields inherited from interface jm.JMC |
AMPLITUDE, DEBUG, DYNAMIC, EIGHT_BIT, FREQUENCY, KEY_SIG_EVT, MONO, NO_DENOMINATOR, NO_INSTRUMENT, NO_KEY_QUALITY, NO_KEY_SIGNATURE, NO_NUMERATOR, OCTAPHONIC, PAN, PITCH, PROG_EVT, QUADRAPHONIC, RHYTHM, SIXTEEN_BIT, STEREO, TEMP_EVT, THIRTY_TWO_BIT, TIME_SIG_EVT, VERBOSE |
| Fields inherited from interface jm.constants.Durations |
C, CD, CDD, CROTCHET, CROTCHET_TRIPLET, CT, DC, DDC, DDEN, DDHN, DDM, DDQ, DDQN, DEMI_SEMI_QUAVER, DEMI_SEMI_QUAVER_TRIPLET, DEN, DHN, DM, DOTTED_CROTCHET, DOTTED_EIGHTH_NOTE, DOTTED_HALF_NOTE, DOTTED_MINIM, DOTTED_QUARTER_NOTE, DOTTED_QUAVER, DOTTED_SEMI_QUAVER, DOTTED_SIXTEENTH_NOTE, DOUBLE_DOTTED_CROTCHET, DOUBLE_DOTTED_EIGHTH_NOTE, DOUBLE_DOTTED_HALF_NOTE, DOUBLE_DOTTED_MINIM, DOUBLE_DOTTED_QUARTER_NOTE, DOUBLE_DOTTED_QUAVER, DQ, DQN, DSN, DSQ, DSQT, EIGHTH_NOTE, EIGHTH_NOTE_TRIPLET, EN, ENT, HALF_NOTE, HALF_NOTE_TRIPLET, HN, HNT, M, MD, MDD, MINIM, MINIM_TRIPLET, MT, Q, QD, QDD, QN, QNT, QT, QUARTER_NOTE, QUARTER_NOTE_TRIPLET, QUAVER, QUAVER_TRIPLET, SB, SEMI_QUAVER, SEMI_QUAVER_TRIPLET, SEMIBREVE, SIXTEENTH_NOTE, SIXTEENTH_NOTE_TRIPLET, SN, SNT, SQ, SQD, SQT, THIRTYSECOND_NOTE, THIRTYSECOND_NOTE_TRIPLET, TN, TNT, TSN, TSNT, WHOLE_NOTE, WN |
| Fields inherited from interface jm.constants.Frequencies |
FRQ |
| Fields inherited from interface jm.constants.Tunings |
EQUAL, JUST, MEAN, PYTHAGOREAN |
| Fields inherited from interface jm.constants.Volumes |
F, FF, FFF, FORTE, FORTISSIMO, MEZZO_FORTE, MEZZO_PIANO, MF, MP, P, PIANISSIMO, PP, PPP, SILENT |
| Fields inherited from interface jm.constants.Panning |
PAN_CENTER, PAN_CENTRE, PAN_LEFT, PAN_RIGHT |
| Fields inherited from interface jm.constants.DrumMap |
ACOUSTIC_BASS_DRUM, ACOUSTIC_SNARE, BASS_DRUM_1, CABASA, CHINESE_CYMBAL, CLAVES, CLOSED_HI_HAT, COWBELL, CRASH_CYMBAL_1, CRASH_CYMBAL_2, ELECTRIC_SNARE, HAND_CLAP, HI_BONGO, HI_MID_TOM, HI_WOOD_BLOCK, HIGH_AGOGO, HIGH_FLOOR_TOM, HIGH_TIMBALE, HIGH_TOM, LONG_GUIRO, LONG_WHISTLE, LOW_AGOGO, LOW_BONGO, LOW_CONGA, LOW_FLOOR_TOM, LOW_MID_TOM, LOW_TIMBALE, LOW_TOM, LOW_WOOD_BLOCK, MARACAS, MUTE_CUICA, MUTE_HI_CONGA, MUTE_TRIANGLE, OPEN_CUICA, OPEN_HI_CONGA, OPEN_HI_HAT, OPEN_TRIANGLE, PEDAL_HI_HAT, RIDE_BELL, RIDE_CYMBAL_1, RIDE_CYMBAL_2, SHORT_GUIRO, SHORT_WHISTLE, SIDE_STICK, SPLASH_CYMBAL, TAMBOURINE, VIBRASLAP |
| Fields inherited from interface jm.constants.Scales |
AEOLIAN_SCALE, BLUES_SCALE, CHROMATIC_SCALE, DIATONIC_MINOR_SCALE, DORIAN_SCALE, HARMONIC_MINOR_SCALE, INDIAN_SCALE, LYDIAN_SCALE, MAJOR_SCALE, MELODIC_MINOR_SCALE, MINOR_SCALE, MIXOLYDIAN_SCALE, NATURAL_MINOR_SCALE, PENTATONIC_SCALE, TURKISH_SCALE |
| Fields inherited from interface jm.constants.Waveforms |
COSINE_WAVE, PULSE_WAVE, SABERSAW_WAVE, SAWDOWN_WAVE, SAWTOOTH_WAVE, SINE_WAVE, SQUARE_WAVE, TRIANGLE_WAVE |
| Fields inherited from interface jm.constants.Noises |
BROWN_NOISE, FRACTAL_NOISE, SMOOTH_NOISE, STEP_NOISE, WHITE_NOISE |
| Fields inherited from interface jm.constants.Alignments |
AFTER, BEFORE, CENTER_ALIGN, CENTER_ON_END, CENTER_ON_START, CENTRE_ALIGN, CENTRE_ON_END, CENTRE_ON_START, END_ON_CENTER, END_ON_CENTRE, END_TOGETHER, START_ON_CENTER, START_ON_CENTRE, START_TOGETHER |
| Constructor Summary | |
Score()
//---------------------------------------------- // Constructors //---------------------------------------------- /** Constructs an empty score with a default name |
|
Score(double tempo)
Constructs an empty score at the specified tempo |
|
Score(Part part)
Constructs a Score containing the specified part. |
|
Score(Part[] parts)
Constructs a Score containing the specified parts. |
|
Score(Part[] parts,
java.lang.String title)
Constructs a Score containing the specified parts with
the specified title. |
|
Score(Part[] parts,
java.lang.String title,
double tempo)
Constructs a Score containing the specified parts with
the specified title and the specified tempo. |
|
Score(Part part,
java.lang.String title)
Constructs a Score containing the specified part with
the specified title. |
|
Score(Part part,
java.lang.String title,
double tempo)
Constructs a Score containing the specified part with
the specified title and the specified tempo. |
|
Score(java.lang.String title)
Constructs an empty score. |
|
Score(java.lang.String title,
double tempo)
Constructs an empty score. |
|
Score(java.lang.String title,
double tempo,
Part part)
Constructs a Score containing the specified part. |
|
| Method Summary | |
void |
add(Part part)
Add a Track object to this Score |
void |
addPart(Part part)
Add a Track object to this Score |
void |
addPartList(Part[] partArray)
Adds multiple parts to the score from an array of parts |
void |
clean()
Remove any empty Parts or phrases from the Score. |
Score |
copy()
Make a copy of this Score object |
Score |
copy(double startTime,
double endTime)
|
Part |
createPart()
Generates and returns a new empty part and adds it to the score. |
void |
empty()
Empty removes all elements in the vector |
void |
empty(boolean nullObjects)
Empty removes all elements in the vector. |
int |
getDenominator()
Returns the Score's time signature denominator |
double |
getEndTime()
Return the beat where score ends. |
int |
getHighestPitch()
Return the value of the highest note in the Score. |
int |
getKeyQuality()
Returns the Score's key quality 0 is Major, 1 is minor |
int |
getKeySignature()
' Returns the Score's key signature The number of sharps (+) or flats (-) |
double |
getLongestRhythmValue()
Return the value of the longest rhythm value in the Score. |
int |
getLowestPitch()
Return the value of the lowest note in the Score. |
int |
getNumerator()
Returns the Score's time signature numerator |
Part |
getPart(int number)
Get an individual Track object from its number |
Part |
getPart(java.lang.String title)
Get an individual Track object from its title |
Part[] |
getPartArray()
Returns the all Parts in this Score as a array |
java.util.Vector |
getPartList()
Returns the Scores List of Tracks |
double |
getShortestRhythmValue()
Return the value of the shortest rhythm value in the Score. |
int |
getSize()
Get the number of Parts in this score |
double |
getTempo()
Returns the Score's tempo |
java.lang.String |
getTitle()
Return the title of this Score |
int |
getVolume()
Returns the Score's volume |
void |
insertPart(Part part,
int index)
Inserts part at the specified position, shifting all parts
with indices greater than or equal to index up one position. |
int |
length()
Get the number of Parts in this score |
void |
removeAllParts()
Deletes all the parts previously added to the score |
void |
removeLastPart()
Deletes the last Part added to the Score |
void |
removePart(int partNumb)
Deletes the specified Part in the Score |
void |
removePart(Part part)
Deletes the first occurence of the specified part in the Score. |
void |
setDenominator(int dem)
Specifies the Score's time signature denominator |
void |
setKeyQuality(int newQual)
Specifies the Score's key quality 0 is Major, 1 is minor |
void |
setKeySignature(int newSig)
Specifies the Score's key signature The number of sharps (+) or flats (-) |
void |
setNumerator(int num)
Specifies the Score's time signature numerator |
void |
setPan(double pan)
Determine the pan position for all notes in this Score. |
void |
setTempo(double tempo)
Sets the Score's tempo |
void |
setTitle(java.lang.String title)
Assign a title to this Score |
void |
setVolume(int volume)
Sets the Score's volume |
int |
size()
Get the number of Parts in this score |
java.lang.String |
toString()
Print the titles of all tracks to stdout |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
DEFAULT_TITLE
public static final java.lang.String DEFAULT_TITLE
- See Also:
- Constant Field Values
DEFAULT_TEMPO
public static final double DEFAULT_TEMPO
- See Also:
- Constant Field Values
DEFAULT_VOLUME
public static final int DEFAULT_VOLUME
- See Also:
- Constant Field Values
DEFAULT_KEY_SIGNATURE
public static final int DEFAULT_KEY_SIGNATURE
- See Also:
- Constant Field Values
DEFAULT_KEY_QUALITY
public static final int DEFAULT_KEY_QUALITY
- See Also:
- Constant Field Values
DEFAULT_NUMERATOR
public static final int DEFAULT_NUMERATOR
- See Also:
- Constant Field Values
DEFAULT_DENOMINATOR
public static final int DEFAULT_DENOMINATOR
- See Also:
- Constant Field Values
title
private java.lang.String title
- the name assigned to a Score
partList
private java.util.Vector partList
- a Vector containing the Part objects associated with this score
tempo
private double tempo
- the speed for this score
volume
private int volume
- the loudness for this score
keySignature
private int keySignature
- the number of accidentals this score
negative numbers are Flats, positive numbers are Sharps
keyQuality
private int keyQuality
- 0 = major, 1 = minor, others modes not specified
numerator
private int numerator
- the top number of the time signature
denominator
private int denominator
- the bottom number of the time signature
| Constructor Detail |
Score
public Score()
- //----------------------------------------------
// Constructors
//----------------------------------------------
/**
Constructs an empty score with a default name
Score
public Score(java.lang.String title)
- Constructs an empty score.
Score
public Score(double tempo)
- Constructs an empty score at the specified tempo
Score
public Score(java.lang.String title, double tempo)
- Constructs an empty score.
Score
public Score(Part part)
- Constructs a Score containing the specified
part.
Score
public Score(java.lang.String title, double tempo, Part part)
- Constructs a Score containing the specified
part.
Score
public Score(Part[] parts)
- Constructs a Score containing the specified
parts.
Score
public Score(Part part, java.lang.String title)
- Constructs a Score containing the specified
partwith the specifiedtitle.
Score
public Score(Part[] parts, java.lang.String title)
- Constructs a Score containing the specified
partswith the specifiedtitle.
Score
public Score(Part part, java.lang.String title, double tempo)
- Constructs a Score containing the specified
partwith the specifiedtitleand the specifiedtempo.
Score
public Score(Part[] parts, java.lang.String title, double tempo)
- Constructs a Score containing the specified
partswith the specifiedtitleand the specifiedtempo.
| Method Detail |
add
public void add(Part part)
- Add a Track object to this Score
addPart
public void addPart(Part part)
- Add a Track object to this Score
insertPart
public void insertPart(Part part, int index) throws java.lang.ArrayIndexOutOfBoundsException
- Inserts
partat the specified position, shifting all parts with indices greater than or equal toindexup one position.
addPartList
public void addPartList(Part[] partArray)
- Adds multiple parts to the score from an array of parts
removePart
public void removePart(int partNumb)
- Deletes the specified Part in the Score
removePart
public void removePart(Part part)
- Deletes the first occurence of the specified part in the Score.
removeLastPart
public void removeLastPart()
- Deletes the last Part added to the Score
removeAllParts
public void removeAllParts()
- Deletes all the parts previously added to the score
getPartList
public java.util.Vector getPartList()
- Returns the Scores List of Tracks
getPartArray
public Part[] getPartArray()
- Returns the all Parts in this Score as a array
getPart
public Part getPart(java.lang.String title)
- Get an individual Track object from its title
getPart
public Part getPart(int number)
- Get an individual Track object from its number
getTitle
public java.lang.String getTitle()
- Return the title of this Score
setTitle
public void setTitle(java.lang.String title)
- Assign a title to this Score
getTempo
public double getTempo()
- Returns the Score's tempo
setTempo
public void setTempo(double tempo)
- Sets the Score's tempo
getVolume
public int getVolume()
- Returns the Score's volume
setVolume
public void setVolume(int volume)
- Sets the Score's volume
getKeySignature
public int getKeySignature()
- '
Returns the Score's key signature
The number of sharps (+) or flats (-)
setKeySignature
public void setKeySignature(int newSig)
- Specifies the Score's key signature
The number of sharps (+) or flats (-)
getKeyQuality
public int getKeyQuality()
- Returns the Score's key quality
0 is Major, 1 is minor
setKeyQuality
public void setKeyQuality(int newQual)
- Specifies the Score's key quality
0 is Major, 1 is minor
getNumerator
public int getNumerator()
- Returns the Score's time signature numerator
setNumerator
public void setNumerator(int num)
- Specifies the Score's time signature numerator
getDenominator
public int getDenominator()
- Returns the Score's time signature denominator
setDenominator
public void setDenominator(int dem)
- Specifies the Score's time signature denominator
copy
public Score copy()
- Make a copy of this Score object
copy
public Score copy(double startTime, double endTime)
getEndTime
public double getEndTime()
- Return the beat where score ends. Where it's last Part ends.
toString
public java.lang.String toString()
- Print the titles of all tracks to stdout
empty
public void empty()
- Empty removes all elements in the vector
empty
public void empty(boolean nullObjects)
- Empty removes all elements in the vector.
length
public int length()
- Get the number of Parts in this score
size
public int size()
- Get the number of Parts in this score
getSize
public int getSize()
- Get the number of Parts in this score
clean
public void clean()
- Remove any empty Parts or phrases from the Score.
getHighestPitch
public int getHighestPitch()
- Return the value of the highest note in the Score.
getLowestPitch
public int getLowestPitch()
- Return the value of the lowest note in the Score.
getLongestRhythmValue
public double getLongestRhythmValue()
- Return the value of the longest rhythm value in the Score.
getShortestRhythmValue
public double getShortestRhythmValue()
- Return the value of the shortest rhythm value in the Score.
setPan
public void setPan(double pan)
- Determine the pan position for all notes in this Score.
createPart
public Part createPart()
- Generates and returns a new empty part
and adds it to the score.
|
|||||||||
| Home >> All >> jm >> music >> [ data overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
jm.music.data.Score