def recip_to_duration(recip):
    """Convert a humdrum recip string to a wholenote duration.
    """
    # Breves are indicated by zero.
    if recip[0] == '0':
        duration = 2
    else:
        duration = float(recip.rstrip('.')) ** -1

    dots = recip.count('.')

    return (2 * duration) - duration*(2.0 ** (-1 * dots))