ie.ncl.media.music
Class Note
java.lang.Object
ie.ncl.media.music.Note
public class Note
- extends java.lang.Object
Constructor Summary |
Note(int duration)
|
Note(int duration,
int pitch,
int scale)
Create a note of the specified duration, pitch and scale. |
Note(int d,
int p,
int s,
boolean dotted)
|
Note(int d,
int p,
int s,
int specifier)
|
Note(int d,
int p,
int s,
int specifier,
int style)
Construct a Note. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UNKNOWN
public static final int UNKNOWN
- See Also:
- Constant Field Values
PAUSE
public static final int PAUSE
- See Also:
- Constant Field Values
REST
public static final int REST
- See Also:
- Constant Field Values
STYLE_NORMAL
public static final int STYLE_NORMAL
- See Also:
- Constant Field Values
STYLE_CONTINUOUS
public static final int STYLE_CONTINUOUS
- See Also:
- Constant Field Values
STYLE_STACCATO
public static final int STYLE_STACCATO
- See Also:
- Constant Field Values
PITCH_MIN
public static final int PITCH_MIN
- See Also:
- Constant Field Values
PITCH_MAX
public static final int PITCH_MAX
- See Also:
- Constant Field Values
SCALE_MIN
public static final int SCALE_MIN
- See Also:
- Constant Field Values
SCALE_MAX
public static final int SCALE_MAX
- See Also:
- Constant Field Values
SPECIFIER_NONE
public static final int SPECIFIER_NONE
- See Also:
- Constant Field Values
SPECIFIER_DOTTED
public static final int SPECIFIER_DOTTED
- See Also:
- Constant Field Values
SPECIFIER_DOUBLE_DOTTED
public static final int SPECIFIER_DOUBLE_DOTTED
- See Also:
- Constant Field Values
SPECIFIER_TWO_THIRDS
public static final int SPECIFIER_TWO_THIRDS
- See Also:
- Constant Field Values
Note
public Note(int duration)
throws MelodyException
- Throws:
MelodyException
Note
public Note(int duration,
int pitch,
int scale)
throws MelodyException
- Create a note of the specified duration, pitch and scale.
- Throws:
MelodyException
Note
public Note(int d,
int p,
int s,
boolean dotted)
throws MelodyException
- Throws:
MelodyException
Note
public Note(int d,
int p,
int s,
int specifier)
throws MelodyException
- Throws:
MelodyException
Note
public Note(int d,
int p,
int s,
int specifier,
int style)
throws MelodyException
- Construct a Note.
Duration is 1,2,4,8,16,32 for full note, 1/2 note, 1/4 note, 1/8 note, 1/16 note and 1/32 note respectively.
Pitch is a number from 0 to 11 representing C to B respectively.
Scale is a number from 4 to 7 representing A at 440Hz to A at 3.52 kHz respectively.
Specifier can be none, dotted, double dotted or two thirds (see SPECIFIER constants).
Style can be normal, continuous or staccato (see STYLE constants).
Middle C has pitch 0 and a scale of 4.
- Throws:
MelodyException
getStyle
public int getStyle()
getDuration
public int getDuration()
getPitch
public int getPitch()
isRest
public boolean isRest()
getScale
public int getScale()
getSpecifier
public int getSpecifier()
setSpecifier
public void setSpecifier(int s)
isDotted
public boolean isDotted()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object