def parse_octave(string):

    if string:
        size = string.count(string[0])
        return size + 4 if string[0] == "'" else -size + 5
    else:
        return 5
5 is central octave. Return 5 as a fall-back
dataset/ETHPy150Open kroger/pyknon/pyknon/notation.py/parse_octave