|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.siemens.mp.game.MelodyComposer
This class implements a melody composing facility.
The user can compose a melody using predefined tones and tonelengths,
set beats per minute and then get the resulting Melody
object for playing.
Field Summary | |
static int |
BPM
Default beats per minute |
static int |
NO_TONE
special constant: No tone |
static int |
TONE_A0
A note, octave 0 |
static int |
TONE_A1
A note, octave 1 |
static int |
TONE_A2
A note, octave 2 |
static int |
TONE_A3
A note, octave 3 |
static int |
TONE_A4
A note, octave 4 |
static int |
TONE_AIS0
A# note, octave 0 |
static int |
TONE_AIS1
A# note, octave 1 |
static int |
TONE_AIS2
A# note, octave 2 |
static int |
TONE_AIS3
A# note, octave 3 |
static int |
TONE_C0
C note, octave 0 |
static int |
TONE_C1
C note, octave 1 |
static int |
TONE_C2
C note, octave 2 |
static int |
TONE_C3
C note, octave 3 |
static int |
TONE_C4
C note, octave 4 |
static int |
TONE_CIS0
C# note, octave 0 |
static int |
TONE_CIS1
C# note, octave 1 |
static int |
TONE_CIS2
C# note, octave 2 |
static int |
TONE_CIS3
C# note, octave 3 |
static int |
TONE_CIS4
C# note, octave 4 |
static int |
TONE_D0
D note, octave 0 |
static int |
TONE_D1
D note, octave 1 |
static int |
TONE_D2
D note, octave 2 |
static int |
TONE_D3
D note, octave 3 |
static int |
TONE_D4
D note, octave 4 |
static int |
TONE_DIS0
D# note, octave 0 |
static int |
TONE_DIS1
D# note, octave 1 |
static int |
TONE_DIS2
D# note, octave 2 |
static int |
TONE_DIS3
D# note, octave 3 |
static int |
TONE_DIS4
D# note, octave 4 |
static int |
TONE_E0
E note, octave 0 |
static int |
TONE_E1
E note, octave 1 |
static int |
TONE_E2
E note, octave 2 |
static int |
TONE_E3
E note, octave 3 |
static int |
TONE_E4
E note, octave 4 |
static int |
TONE_F0
F note, octave 0 |
static int |
TONE_F1
F note, octave 1 |
static int |
TONE_F2
F note, octave 2 |
static int |
TONE_F3
F note, octave 3 |
static int |
TONE_F4
F note, octave 4 |
static int |
TONE_FIS0
F# note, octave 0 |
static int |
TONE_FIS1
F# note, octave 1 |
static int |
TONE_FIS2
F# note, octave 2 |
static int |
TONE_FIS3
F# note, octave 3 |
static int |
TONE_FIS4
F# note, octave 4 |
static int |
TONE_G0
G note, octave 0 |
static int |
TONE_G1
G note, octave 1 |
static int |
TONE_G2
G note, octave 2 |
static int |
TONE_G3
G note, octave 3 |
static int |
TONE_G4
G note, octave 4 |
static int |
TONE_GIS0
G# note, octave 0 |
static int |
TONE_GIS1
G# note, octave 1 |
static int |
TONE_GIS2
G# note, octave 2 |
static int |
TONE_GIS3
G# note, octave 3 |
static int |
TONE_GIS4
G# note, octave 4 |
static int |
TONE_H0
H note, octave 0 |
static int |
TONE_H1
H note, octave 1 |
static int |
TONE_H2
H note, octave 2 |
static int |
TONE_H3
H note, octave 3 |
static int |
TONE_MARK
special constant: Sets a marker as starting point of the following repeat variants |
static int |
TONE_PAUSE
special constant: pause |
static int |
TONE_REPEAT
special constant: REPEAT n times from the very beginning please use an integer value for "n" in the length parameter! |
static int |
TONE_REPEAT_MARK
special constant: REPEAT n times from the preceding TONE_MARK please use an integer value for "n" in the length parameter! |
static int |
TONE_REPEV
special constant: REPEAT forever from the very beginning |
static int |
TONE_REPEV_MARK
special constant: REPEAT forever from the preceding TONE_MARK |
static int |
TONE_REPON
special constant: REPEAT n times from the very beginning, then go ON please use an integer value for "n" in the length parameter! |
static int |
TONE_REPON_MARK
special constant: REPEAT n times from the preceding TONE_MARK, then go ON please use an integer value for "n" in the length parameter! |
static int |
TONE_STOP
special constant: STOP the tone sequence |
static int |
TONELENGTH_1_1
whole note tone length |
static int |
TONELENGTH_1_16
1/16 note tone length |
static int |
TONELENGTH_1_2
1/2 note tone length |
static int |
TONELENGTH_1_32
1/32 note tone length |
static int |
TONELENGTH_1_4
1/4 note tone length |
static int |
TONELENGTH_1_64
1/64 note tone length |
static int |
TONELENGTH_1_8
1/8 note tone length |
static int |
TONELENGTH_DOTTED_1_1
whole note dotted tone length |
static int |
TONELENGTH_DOTTED_1_16
1/16 note dotted tone length |
static int |
TONELENGTH_DOTTED_1_2
1/2 note dotted tone length |
static int |
TONELENGTH_DOTTED_1_32
1/32 note dotted tone length |
static int |
TONELENGTH_DOTTED_1_4
1/4 note dotted tone length |
static int |
TONELENGTH_DOTTED_1_64
1/64 note dotted tone length |
static int |
TONELENGTH_DOTTED_1_8
1/8 note dotted tone length |
Constructor Summary | |
MelodyComposer()
Creates a MelodyComposer object. |
|
MelodyComposer(int[] notes,
int bpm)
Creates a MelodyComposer object and initializes it with the provided melody and beats-per-minute value. |
Method Summary | |
void |
appendNote(int note,
int length)
Appends to the melody one note with specified tone and length, or one special constant. |
Melody |
getMelody()
Returns the composed Melody object.
|
int |
length()
Counts the tones in the composed melody. |
static int |
maxLength()
Returns the maximum possible size of a melody in tones |
void |
resetMelody()
Resets the composed melody and makes it empty. |
void |
setBPM(int bpm)
Sets beats per minute (default: 60). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TONE_C0
public static final int TONE_CIS0
public static final int TONE_D0
public static final int TONE_DIS0
public static final int TONE_E0
public static final int TONE_F0
public static final int TONE_FIS0
public static final int TONE_G0
public static final int TONE_GIS0
public static final int TONE_A0
public static final int TONE_AIS0
public static final int TONE_H0
public static final int TONE_C1
public static final int TONE_CIS1
public static final int TONE_D1
public static final int TONE_DIS1
public static final int TONE_E1
public static final int TONE_F1
public static final int TONE_FIS1
public static final int TONE_G1
public static final int TONE_GIS1
public static final int TONE_A1
public static final int TONE_AIS1
public static final int TONE_H1
public static final int TONE_C2
public static final int TONE_CIS2
public static final int TONE_D2
public static final int TONE_DIS2
public static final int TONE_E2
public static final int TONE_F2
public static final int TONE_FIS2
public static final int TONE_G2
public static final int TONE_GIS2
public static final int TONE_A2
public static final int TONE_AIS2
public static final int TONE_H2
public static final int TONE_C3
public static final int TONE_CIS3
public static final int TONE_D3
public static final int TONE_DIS3
public static final int TONE_E3
public static final int TONE_F3
public static final int TONE_FIS3
public static final int TONE_G3
public static final int TONE_GIS3
public static final int TONE_A3
public static final int TONE_AIS3
public static final int TONE_H3
public static final int TONE_C4
public static final int TONE_CIS4
public static final int TONE_D4
public static final int TONE_DIS4
public static final int TONE_E4
public static final int TONE_F4
public static final int TONE_FIS4
public static final int TONE_G4
public static final int TONE_GIS4
public static final int TONE_A4
public static final int TONE_PAUSE
public static final int NO_TONE
public static final int TONE_STOP
public static final int TONE_REPEAT
public static final int TONE_REPEV
public static final int TONE_REPON
public static final int TONE_MARK
public static final int TONE_REPEAT_MARK
public static final int TONE_REPEV_MARK
public static final int TONE_REPON_MARK
public static final int TONELENGTH_1_1
public static final int TONELENGTH_1_2
public static final int TONELENGTH_1_4
public static final int TONELENGTH_1_8
public static final int TONELENGTH_1_16
public static final int TONELENGTH_1_32
public static final int TONELENGTH_1_64
public static final int TONELENGTH_DOTTED_1_1
public static final int TONELENGTH_DOTTED_1_2
public static final int TONELENGTH_DOTTED_1_4
public static final int TONELENGTH_DOTTED_1_8
public static final int TONELENGTH_DOTTED_1_16
public static final int TONELENGTH_DOTTED_1_32
public static final int TONELENGTH_DOTTED_1_64
public static final int BPM
Constructor Detail |
public MelodyComposer()
public MelodyComposer(int[] notes, int bpm)
notes
- melody consisting of pairs of tones and corresponding tone lengthsbpm
- beats-per-minute value
Method Detail |
public void setBPM(int bpm)
bpm
- new beats per minute value
public void appendNote(int note, int length) throws Exception
note
- a tone or a special constantlength
- the tone length or the special constant's parameter
Exception
public Melody getMelody()
Melody
object.
Melody
object
public void resetMelody()
public int length()
public static int maxLength()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Generated on 2003-10-17 | For further information and updates, please visit Siemens mobile Developer Portal |