private void checkHarmonics(Note n, LinkedHashMap<Note, Boolean> checkNotesList, ArrayList<Complex> freq, HashSet<Note> curNotes)
    {
        if (!checkNotesList.get(n))
        {
            checkNotesList.put(n, true);
            if (checkForThresholdUp(n, freq, noiseThreshold))
            {
                curNotes.add(n);

                double curPeak = -1;
                for (int i = n.getLeftIdx(); i <= n.getRightIdx(); i++)
                {
                    if (freq.get(i).abs() > curPeak)
                    {
                        curPeak = freq.get(i).abs();
                    }
                }


                for (Note h : n.getHarmonicsList())
                {

                    if (!checkForThresholdUp(h, freq, curPeak))
                    {
                        checkNotesList.put(h, true);
                        double maxMag = -1;
                        for (int i = h.getLeftIdx(); i <= h.getRightIdx(); i++)
                        {
                            if (freq.get(i).abs() > maxMag)
                            {
                                maxMag = freq.get(i).abs();
                            }
                        }
                        curPeak = maxMag;
                    }
                    else
                    {
                        if (!checkNotesList.get(h))
                            checkHarmonics(h, checkNotesList, freq, curNotes);
                    }
                }
            }
        }

    }