def _get_qsize(tuning, width):
    """Return a reasonable quarter note size for 'tuning' and 'width'."""
    names = [x.to_shorthand() for x in tuning.tuning]
    basesize = len(max(names)) + 3
    barsize = ((width - basesize) - 2) - 1

    # x * 4 + 0.5x - barsize = 0 4.5x = barsize x = barsize / 4.5
    return max(0, int(barsize / 4.5))
def _get_qsize ( tuning , width ) : names = [ x . to_shorthand ( ) for x in tuning . tuning ] basesize = len ( max ( names ) ) + 3 barsize = ( ( width - basesize ) - 2 ) - 1 return max ( 0 , int ( barsize / 4.5 ) )
Return a reasonable quarter note size for 'tuning' and 'width'.