def clamp(value, parameter):
        """ Clamp value to parameter's min and max values
        """
        value = parameter.min if value < parameter.min else value
        value = parameter.max if value > parameter.max else value
        return value