DropCSharpGuitarTuning.java (1248B)
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 DropCSharpGuitarTuning 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 C2_SHARP(C, 2, "#"), 24 A2(A, 2), 25 D3(D, 3), 26 G3(G, 3), 27 B3(B, 3), 28 E4(E, 4); 29 30 private final String sign; 31 private final int octave; 32 private NoteName name; 33 34 Pitch(NoteName name, int octave, String sign) { 35 this.name = name; 36 this.octave = octave; 37 this.sign = sign; 38 } 39 40 Pitch(NoteName name, int octave) { 41 this.name = name; 42 this.octave = octave; 43 this.sign = ""; 44 } 45 46 public NoteName getName() { 47 return name; 48 } 49 50 @Override 51 public int getOctave() { 52 return octave; 53 } 54 55 @Override 56 public String getSign() { 57 return sign; 58 } 59 } 60 }