|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectfi.jyu.mit.Music.Note
public class Note
Luokka nuottien esittämiseen.
| Nested Class Summary | |
|---|---|
static class |
Note.Delay
Taukoa kuvaava nuotti |
| Field Summary | |
|---|---|
static int |
DELAY
|
| Constructor Summary | |
|---|---|
Note(int note,
int length,
int velocity)
Alutetaan nuotti |
|
Note(Note n)
Tehdään nuotista kopio |
|
| Method Summary | |
|---|---|
int |
getLength()
|
int |
getNote()
|
int |
getVelocity()
|
boolean |
isDelay()
|
String |
message()
Palauttaa nuottia vastaavan tulostettavan viestin |
static String |
message(int note,
int length,
int velocity)
Palauttaa nuottia vastaavan tulostettavan viestin |
void |
setLength(int length)
asetetaan nuotin pituus |
void |
setNote(int note)
Alustetaan nuotin arvo. |
void |
setVelocity(int velocity)
Asetetaan kuinka voimakkaasti painetaan. |
String |
toString()
Muuttaa nuotin merkkijonoksi |
static String |
toString(int note)
Muuttaa modi-nuotin merkkijonoksi. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DELAY
| Constructor Detail |
|---|
public Note(int note,
int length,
int velocity)
note - MIDI-nuotin arvo (21-108)length - Kesto millisekunteinavelocity - Nuotin nk. painovoimakkuus. Oletus on 64.public Note(Note n)
n - nuotti jolla uusi nuotti alustetaan.| Method Detail |
|---|
public void setNote(int note)
note - MIDI-nuotin arvo (21-108)Note n = new Note(30,300,64); n.getNote() === 30; n.setNote(Note.DELAY); n.isDelay() === true; n.setNote(2); n.getNote() === 21; n.setNote(200); n.getNote() === 108; n.setNote(-1); n.isDelay() === true;
public int getNote()
public boolean isDelay()
public void setLength(int length)
length - asetettava pituuspublic int getLength()
public void setVelocity(int velocity)
velocity - Nuotin nk. painovoimakkuus. Oletus on 64.public int getVelocity()
public static String toString(int note)
note - MIDI-nuotin arvo (21-108)
Note.toString(21) === "A0"; Note.toString(22) === "Bb0"; Note.toString(23) === "B0"; Note.toString(24) === "C1"; Note.toString(25) === "C#1"; Note.toString(60) === "C4"; Note.toString(106) === "Bb7"; Note.toString(107) === "B7"; Note.toString(108) === "C8"; Note.toString(-1) === "-";
public String toString()
toString in class ObjectNote n = new Note(60,250,64); n.toString() === "C4";
public static String message(int note,
int length,
int velocity)
note - MIDI-nuotin arvo (21-108)length - Kesto millisekunteinavelocity - Nuotin nk. painovoimakkuus. Oletus on 64.
Note.message(60,250,64) === "' 60' C4 kesto 250 ms"; Note.message(-1,250,64) === "' ' kesto 250 ms";
public String message()
Note n = new Note(60,250,64); n.message() === "' 60' C4 kesto 250 ms";
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||