Nucleo F401REでFM音源を実装するやつ の実装途中で32ポリ音源にしたやつ 外部DACとオペアンプを利用 現在はMCP4922とNJM2737

Dependencies:   AOTTrigon I2CEEPROM MCP4922 mbed

Revision:
11:62da91a1eaf1
Parent:
10:0ffdefe75566
--- a/MIDIUtil.h	Mon Dec 29 09:01:10 2014 +0000
+++ b/MIDIUtil.h	Mon Dec 29 12:48:44 2014 +0000
@@ -4,4 +4,34 @@
 
 inline float getNoteNumberFrequency(int nn) {
     return notenumfreqs[nn];
-}
\ No newline at end of file
+}
+
+enum MIDIMessageType{
+    NoteOn,
+    NoteOff,
+    PolyphonicKeyPressure,
+    ControlChange,
+    ProgramChange,
+    ChannelPressure,
+    PitchBend,
+    ChannelMode,
+    SystemCommon,
+    SystemRealtime,
+};
+
+typedef struct {
+    MIDIMessageType type;
+    char channel;
+    union {
+        char note;
+        char control;
+        char program;
+        char LSB;
+    };
+    union {
+        char velocity;
+        char pressure;
+        char data;
+        char MSB;
+    };
+} MidiMessage;
\ No newline at end of file