def make_pad_parameters(curve_value, threshold_value):
 threshold_range = (MAX_THRESHOLD_STEP - MIN_THRESHOLD_STEP)
 t = (float((threshold_value - MIN_THRESHOLD_STEP)) / float(threshold_range))
 return PadParameters(curve_value, on_threshold=int((((1 - t) * MIN_ON_THRESHOLD) + (t * MAX_ON_THRESHOLD))), off_threshold=int((((1 - t) * MIN_OFF_THRESHOLD) + (t * MAX_OFF_THRESHOLD))))

def make_pad_parameters ( curve_value , threshold_value ) : threshold_range = ( MAX_THRESHOLD_STEP - MIN_THRESHOLD_STEP ) t = ( float ( ( threshold_value - MIN_THRESHOLD_STEP ) ) / float ( threshold_range ) ) return PadParameters ( curve_value , on_threshold = int ( ( ( ( 1 - t ) * MIN_ON_THRESHOLD ) + ( t * MAX_ON_THRESHOLD ) ) ) , off_threshold = int ( ( ( ( 1 - t ) * MIN_OFF_THRESHOLD ) + ( t * MAX_OFF_THRESHOLD ) ) ) )
creates a valid padparameters object merging the sensitivity curve and threshold settings .