Small utility library for MIDI functions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
659 B

  1. #include <stdio.h>
  2. #include <assert.h>
  3. #include "midi-utils.h"
  4. int main(void) {
  5. FILE* f = fopen("cases.txt", "r");
  6. if (!f) {
  7. return -1;
  8. }
  9. char read_note_name[255] = "";
  10. unsigned int read_note_value;
  11. while (!feof(f)) {
  12. fscanf(f, "%s %d\n", read_note_name, &read_note_value);
  13. unsigned int actual_note_value = MIDI_GetNoteFromName(read_note_name);
  14. printf("MIDI_GetNoteFromName(\"%s\")...", read_note_name);
  15. assert(read_note_value == actual_note_value);
  16. printf("OK!\n");
  17. printf("MIDI_GetNoteName(%d)...", read_note_value);
  18. assert(!strcmp(MIDI_GetNoteName(read_note_value), read_note_name));
  19. printf("OK!\n");
  20. }
  21. fclose(f);
  22. return 0;
  23. }