UkuleleDTuning.java (1204B)
1 package com.github.cythara.tuning; 2 3 import com.github.cythara.Note; 4 import com.github.cythara.NoteName; 5 import com.github.cythara.Tuning; 6 7 import static com.github.cythara.NoteName.*; 8 9 public class UkuleleDTuning implements Tuning { 10 11 @Override 12 public Note[] getNotes() { 13 return Pitch.values(); 14 } 15 16 @Override 17 public Note findNote(String name) { 18 return Pitch.valueOf(name); 19 } 20 21 private enum Pitch implements Note { 22 23 A4(A, 4), 24 D4(D, 4), 25 F4_SHARP(F, 4, "#"), 26 B4(B, 4); 27 28 private final String sign; 29 private final int octave; 30 private NoteName name; 31 32 Pitch(NoteName name, int octave, String sign) { 33 this.name = name; 34 this.octave = octave; 35 this.sign = sign; 36 } 37 38 Pitch(NoteName name, int octave) { 39 this.name = name; 40 this.octave = octave; 41 this.sign = ""; 42 } 43 44 public NoteName getName() { 45 return name; 46 } 47 48 @Override 49 public int getOctave() { 50 return octave; 51 } 52 53 @Override 54 public String getSign() { 55 return sign; 56 } 57 } 58 }