def _getDuration(v, line, text):
    """ Takes a string that is a fraction, or a number. Returns whole note portion as float. """
    if '/' in v:
        try:
            return eval(v + '.')
        except:
            raise ValueError("invalid duration value '%s' on line %d: %s" %
                (v, line, text))
    return float(v)
