int main (void)
{
  smpl_t max_value = 100.;
  smpl_t min_value = 0.;
  uint_t steps = 10;

  aubio_parameter_t * param = new_aubio_parameter ( min_value, max_value, steps );

  PRINT_MSG("initial value: %f, steps: %d\n", aubio_parameter_get_current_value
      (param) , aubio_parameter_get_steps (param) );

  PRINT_MSG("target: max_value / 2\n");
  aubio_parameter_set_target_value ( param, max_value );
  get_some_steps ( param );

  PRINT_MSG("target: max_value / 2\n");
  aubio_parameter_set_target_value ( param, max_value / 2 );
  get_some_steps ( param );

  PRINT_MSG("target: max_value * 2\n");
  aubio_parameter_set_target_value ( param, max_value * 2);
  get_some_steps ( param );

  PRINT_MSG("steps: 1, target: -max\n");
  aubio_parameter_set_steps ( param, 1);
  aubio_parameter_set_target_value ( param, - max_value);
  get_some_steps ( param );

  PRINT_MSG("steps: 30, current value: max, target: min\n");
  aubio_parameter_set_current_value ( param, max_value );
  aubio_parameter_set_target_value ( param, min_value );
  aubio_parameter_set_steps ( param, 7 );
  get_some_steps ( param );

  PRINT_MSG("steps: 30, max value: max * 2, min value: -max, current value: -max, target: max\n");
  aubio_parameter_set_min_value ( param, - max_value );
  aubio_parameter_set_max_value ( param, 2. * max_value );
  aubio_parameter_set_current_value ( param, - max_value );
  aubio_parameter_set_target_value ( param, max_value );
  aubio_parameter_set_steps ( param, 10 );
  get_some_steps ( param );

  del_aubio_parameter (param);

  return 0;
}
Exemplo n.º 2
0
uint_t aubio_wavetable_set_amp ( aubio_wavetable_t * s, smpl_t amp )
{
    return aubio_parameter_set_target_value ( s->amp, amp );
}
Exemplo n.º 3
0
uint_t aubio_wavetable_set_freq ( aubio_wavetable_t * s, smpl_t freq )
{
    return aubio_parameter_set_target_value ( s->freq, freq );
}