'Parse alter text to a string of one or two sharps/flats.
Args:
alter_text: A string representation of an integer number of semitones.
Returns:
A string, one of \'bb\', \'b\', \'#\', \'##\', or the empty string.
Raises:
ChordSymbolParseException: If `alter_text` cannot be parsed to an integer,
or if the integer is not a valid number of semitones between -2 and 2
inclusive.'

def _alter_to_string(self, alter_text):

    try:
        alter_semitones = int(alter_text)
    except ValueError:
        raise ChordSymbolParseException(('Non-integer    alter:    ' + str(alter_text)))
    if (alter_semitones == (-2)):
        alter_string = 'bb'
    elif (alter_semitones == (-1)):
        alter_string = 'b'
    elif (alter_semitones == 0):
        alter_string = ''
    elif (alter_semitones == 1):
        alter_string = '#'
    elif (alter_semitones == 2):
        alter_string = '##'
    else:
        raise ChordSymbolParseException(('Invalid    alter:    ' + str(alter_semitones)))
    return alter_string
