public static String getTriadChordName(ArrayList<Key> chord){

        String name = "";

        //add the root note
        name += chord.get(0).getStringNote();

        //check if the third is major or minor
        String third = (NotesUtils.getIntervalBetweenTwoKeys(chord.get(1).getMidiKey(), chord.get(0).getMidiKey()) == 4) ? "major" : "minor";

        //check if the fifth is diminished or augmented
        String fifth = null;
        if (NotesUtils.getIntervalBetweenTwoKeys(chord.get(2).getMidiKey(), chord.get(0).getMidiKey()) == 6)
            fifth = "dim";
        else if (NotesUtils.getIntervalBetweenTwoKeys(chord.get(2).getMidiKey(), chord.get(0).getMidiKey()) == 7)
            fifth = "perfect";
        else if (NotesUtils.getIntervalBetweenTwoKeys(chord.get(2).getMidiKey(), chord.get(0).getMidiKey()) == 8)
            fifth = "aug";

        if (third == "minor" && fifth == "dim")
            name += "dim";
        else if (third == "major" && fifth == "aug")
            name += "aug";
        else
            name += (third=="major") ? "": "m";


        return name;
    }