plectrum

Plectrum: instrument tuner for Android
Log | Files | Refs | README | LICENSE

BassTuning.java (1028B)


      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 BassTuning 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         E1(E, 1),
     24         A1(A, 1),
     25         D2(D, 2),
     26         G2(G, 2);
     27 
     28         private final String sign;
     29         private final int octave;
     30         private NoteName name;
     31 
     32         Pitch(NoteName name, int octave) {
     33             this.name = name;
     34             this.octave = octave;
     35             this.sign = "";
     36         }
     37 
     38         public NoteName getName() {
     39             return name;
     40         }
     41 
     42         @Override
     43         public int getOctave() {
     44             return octave;
     45         }
     46 
     47         @Override
     48         public String getSign() {
     49             return sign;
     50         }
     51     }
     52 }