Creates a new note for a flat tone, such as A-flat. @param octave The octave where the note is in. Has to be 0 - 1. @param tone The tone within the octave. @return The new note.
(int octave, @NotNull Tone tone)
| 168 | * @return The new note. |
| 169 | */ |
| 170 | @NotNull |
| 171 | public static Note flat(int octave, @NotNull Tone tone) { |
| 172 | Preconditions.checkArgument(octave != 2, "Octave cannot be 2 for flats"); |
| 173 | tone = tone == Tone.G ? Tone.F : Tone.values()[tone.ordinal() - 1]; |
| 174 | return new Note(octave, tone, tone.isSharpable()); |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Creates a new note for a sharp tone, such as A-sharp. |