def wave_overtone_relative_amplitude(wavetype='saw', overtone=2):
    """
    Return the relative amplitude of the overtone given the wavetype

    Available wavetypes are: saw, sine, square, and tri (triangle)
    """
    if overtone <= 0:
        raise ValueError('Overtone should be >= 1 (f0 = overtone 1)')
    if wavetype == 'saw':
        return 1 / overtone
    elif wavetype == 'square':
        return 1 / overtone * (overtone % 2)
    elif wavetype == 'sine':
        return 1 if overtone == 1 else 0
    elif wavetype == 'tri':
        return 1 / overtone ** 2 * (overtone % 2)
    else:
        raise KeyError(
            'wavetype not known, should be one of saw, square, sine or tri')
