Beispiel #1
0
static void
down_click_handler(ClickRecognizerRef recognizer, void *context) {

    cur_p = next_project(cur_p, -1);

    display_note();
}
Beispiel #2
0
void note_from_frequency(float freq) {
  float n = half_steps_from_frequency(freq);
  int index = round(n);
  char note = note_from_index(index);
  int alteration = 0;

  float decimal_part = abs(modf(n, NULL));
  if (decimal_part > 0.5) {
    decimal_part = decimal_part - 1;
  }
  decimal_part = decimal_part * 2;

  if (note == 'x') {
    if (decimal_part > 0) {
      alteration = index > 0 ? 1 : -1;
    } else {
      alteration = index > 0 ? -1 : 1;
    }
  }
  note = note_from_index(index - alteration);

  display_note(note);
  display_alteration(alteration);
  display_decimal_part(decimal_part);
}
Beispiel #3
0
static void
long_click_handler(ClickRecognizerRef recognizer, void *context) {

    proj_time[cur_p] = 0;
    proj_start[cur_p] = 0;		/* init again */
    proj_running[cur_p] = false;
    proj_stopped_note(localtime(&now), cur_p);
    write_proj_change_info();

    display_note();
}