def keysort(keylist):
    """
    Sort a list of (instrument, channel_number) keys where the channel
    numbers are sorted numerically rather than alphabetically.
    """
    newlist = [(inst, int(chan)) for (inst, chan) in keylist]
    newlist.sort()
    return [(inst, str(chan)) for (inst, chan) in newlist]