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.

55 lines
939 B

  1. #ifndef MIDI_UTILS_H
  2. #define MIDI_UTILS_H
  3. #include <stdio.h>
  4. #include <string.h>
  5. /**
  6. * MIDI message type for note on.
  7. */
  8. #define MIDI_MESSAGE_NOTEON 0x90u
  9. /**
  10. * MIDI message type for note off.
  11. */
  12. #define MIDI_MESSAGE_NOTEOFF 0x80u
  13. /**
  14. * Continuous control number for sustain, or damper (right pedal).
  15. */
  16. #define MIDI_CC_SUSTAIN 0x40u
  17. /**
  18. * Continuous control number for sostenuto (center pedal).
  19. */
  20. #define MIDI_CC_SOSTENUTO 0x42u
  21. /**
  22. * Continuous control number for una corda (left pedal).
  23. */
  24. #define MIDI_CC_UNACORDA 0x43u
  25. #if defined __cplusplus
  26. extern "C" {
  27. #endif
  28. /**
  29. * Gets the name of a MIDI note value.
  30. * @return The MIDI note name.
  31. * @see MIDI_GetNoteFromName()
  32. */
  33. char* MIDI_GetNoteName(unsigned char);
  34. /**
  35. * Gets the note value from a MIDI note name
  36. * @return The MIDI note value.
  37. * @see MIDI_GetNoteName()
  38. */
  39. unsigned char MIDI_GetNoteFromName(const char*);
  40. #if defined __cplusplus
  41. }
  42. #endif
  43. #endif