public class Note extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Note.Tone
An enum holding tones.
|
Constructor and Description |
---|
Note(int note)
Creates a new note.
|
Note(int octave,
@NotNull Note.Tone tone,
boolean sharped)
Creates a new note.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static @NotNull Note |
flat(int octave,
@NotNull Note.Tone tone)
Creates a new note for a flat tone, such as A-flat.
|
@NotNull Note |
flattened() |
byte |
getId()
Deprecated.
Magic value
|
int |
getOctave()
Returns the octave of this note.
|
@NotNull Note.Tone |
getTone()
Returns the tone of this note.
|
int |
hashCode() |
boolean |
isSharped()
Returns if this note is sharped.
|
static @NotNull Note |
natural(int octave,
@NotNull Note.Tone tone)
Creates a new note for a natural tone, such as A-natural.
|
static @NotNull Note |
sharp(int octave,
@NotNull Note.Tone tone)
Creates a new note for a sharp tone, such as A-sharp.
|
@NotNull Note |
sharped() |
String |
toString() |
public Note(int note)
note
- Internal note id. getId()
always return this
value. The value has to be in the interval [0; 24].@NotNull public static @NotNull Note flat(int octave, @NotNull @NotNull Note.Tone tone)
octave
- The octave where the note is in. Has to be 0 - 1.tone
- The tone within the octave.@NotNull public static @NotNull Note sharp(int octave, @NotNull @NotNull Note.Tone tone)
octave
- The octave where the note is in. Has to be 0 - 2.tone
- The tone within the octave. If the octave is 2 the note has
to be F#.@NotNull public static @NotNull Note natural(int octave, @NotNull @NotNull Note.Tone tone)
octave
- The octave where the note is in. Has to be 0 - 1.tone
- The tone within the octave.@Deprecated public byte getId()
public int getOctave()
@NotNull public @NotNull Note.Tone getTone()
public boolean isSharped()
Copyright © 2021. All rights reserved.