private int toInt(String string) {
        int result = 12;
        switch (string.charAt(0)) {
        case 'A':
            result += 0;
            break;
        case 'B':
            result += 2;
            break;
        case 'C':
            result += 3;
            break;
        case 'D':
            result += 5;
            break;
        case 'E':
            result += 7;
            break;
        case 'F':
            result += 8;
            break;
        case 'G':
            result += 10;
            break;
        }

        if (string.length() == 2) {
            char mod = string.charAt(1);
            if (mod == '#') {
                result++;
            } else {
                result--;
            }
        }

        return result % 12;
    }