// Path: app/src/main/java/com/github/cythara/tuning/NoteFrequencyCalculator.java
// public class NoteFrequencyCalculator {
// 
//     private static List<String> notes =
//             Arrays.asList("C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B");
//     private float referenceFrequency;
// 
//     public NoteFrequencyCalculator(float referenceFrequency) {
//         this.referenceFrequency = referenceFrequency;
//     }
// 
//     public double getFrequency(Note note) {
//         int semitonesPerOctave = 12;
//         int referenceOctave = 4;
//         double distance = semitonesPerOctave * (note.getOctave() - referenceOctave);
// 
//         distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A");
// 
//         return referenceFrequency * Math.pow(2, distance / 12);
//     }
// }


import com.github.cythara.tuning.NoteFrequencyCalculator;
import java.util.Arrays;
package com.github.cythara;



class PitchComparator {

    static PitchDifference retrieveNote(float pitch) {
        Tuning tuning = MainActivity.getCurrentTuning();
        int referencePitch = MainActivity.getReferencePitch();

        Note[] tuningNotes = tuning.getNotes();
        Note[] notes;

        if (MainActivity.isAutoModeEnabled()) {
            notes = tuningNotes;
        } else {
            notes = new Note[]{tuningNotes[MainActivity.getReferencePosition()]};
        }

// Path: app/src/main/java/com/github/cythara/tuning/NoteFrequencyCalculator.java
// public class NoteFrequencyCalculator {
// 
//     private static List<String> notes =
//             Arrays.asList("C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B");
//     private float referenceFrequency;
// 
//     public NoteFrequencyCalculator(float referenceFrequency) {
//         this.referenceFrequency = referenceFrequency;
//     }
// 
//     public double getFrequency(Note note) {
//         int semitonesPerOctave = 12;
//         int referenceOctave = 4;
//         double distance = semitonesPerOctave * (note.getOctave() - referenceOctave);
// 
//         distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A");
// 
//         return referenceFrequency * Math.pow(2, distance / 12);
//     }
// }


// Path: app/src/main/java/com/github/cythara/PitchComparator.java
import com.github.cythara.tuning.NoteFrequencyCalculator;
import java.util.Arrays;

package com.github.cythara;



class PitchComparator {

    static PitchDifference retrieveNote(float pitch) {
        Tuning tuning = MainActivity.getCurrentTuning();
        int referencePitch = MainActivity.getReferencePitch();

        Note[] tuningNotes = tuning.getNotes();
        Note[] notes;

        if (MainActivity.isAutoModeEnabled()) {
            notes = tuningNotes;
        } else {
            notes = new Note[]{tuningNotes[MainActivity.getReferencePosition()]};
        }

        NoteFrequencyCalculator noteFrequencyCalculator =