Nucleo F401REでFM音源を実装するやつ 外部DACとオペアンプを利用 現在はMCP4922とNJM2737

Dependencies:   AOTTrigon I2CEEPROM MCP4922 AQM0802A mbed

Fork of NuMidi401 by Yuu Kobayashi

NuFM401

Nucleo F401用の自作ソフトウェアMIDI音源

概要

だいたいそんなもんです。

特徴

  • ブレッドボードの上で組める程度には簡単な回路構成
  • 外部のDACにMCP4922を採用
  • 念のためのボルテージフォロアとしてNJM2737Dを採用
  • バンク用EEPROMに24FC1025を採用
  • シリアル経由でMIDIデータを受信することで操作

補足

シリアル <=> MIDI のドライバにはHairless-MIDISerialをオススメします。 仮想MIDIケーブルはとりあえずMIDI Yokeで。

Revision:
10:0ffdefe75566
Parent:
7:439c57c20593
--- a/MIDIUtil.cpp	Mon Dec 29 02:42:03 2014 +0000
+++ b/MIDIUtil.cpp	Mon Dec 29 09:01:10 2014 +0000
@@ -1,135 +1,131 @@
 
-double notenumfreqs[]={
-    8.175799,
-    8.661957,
-    9.177024,
-    9.722718,
-    10.300861,
-    10.913382,
-    11.562326,
-    12.249857,
-    12.978272,
-    13.750000,
-    14.567618,
-    15.433853,
-    16.351598,
-    17.323914,
-    18.354048,
-    19.445436,
-    20.601722,
-    21.826764,
-    23.124651,
-    24.499715,
-    25.956544,
-    27.500000,
-    29.135235,
-    30.867706,
-    32.703196,
-    34.647829,
-    36.708096,
-    38.890873,
-    41.203445,
-    43.653529,
-    46.249303,
-    48.999429,
-    51.913087,
-    55.000000,
-    58.270470,
-    61.735413,
-    65.406391,
-    69.295658,
-    73.416192,
-    77.781746,
-    82.406889,
-    87.307058,
-    92.498606,
-    97.998859,
-    103.826174,
-    110.000000,
-    116.540940,
-    123.470825,
-    130.812783,
-    138.591315,
-    146.832384,
-    155.563492,
-    164.813778,
-    174.614116,
-    184.997211,
-    195.997718,
-    207.652349,
-    220.000000,
-    233.081881,
-    246.941651,
-    261.625565,
-    277.182631,
-    293.664768,
-    311.126984,
-    329.627557,
-    349.228231,
-    369.994423,
-    391.995436,
-    415.304698,
-    440.000000,
-    466.163762,
-    493.883301,
-    523.251131,
-    554.365262,
-    587.329536,
-    622.253967,
-    659.255114,
-    698.456463,
-    739.988845,
-    783.990872,
-    830.609395,
-    880.000000,
-    932.327523,
-    987.766603,
-    1046.502261,
-    1108.730524,
-    1174.659072,
-    1244.507935,
-    1318.510228,
-    1396.912926,
-    1479.977691,
-    1567.981744,
-    1661.218790,
-    1760.000000,
-    1864.655046,
-    1975.533205,
-    2093.004522,
-    2217.461048,
-    2349.318143,
-    2489.015870,
-    2637.020455,
-    2793.825851,
-    2959.955382,
-    3135.963488,
-    3322.437581,
-    3520.000000,
-    3729.310092,
-    3951.066410,
-    4186.009045,
-    4434.922096,
-    4698.636287,
-    4978.031740,
-    5274.040911,
-    5587.651703,
-    5919.910763,
-    6271.926976,
-    6644.875161,
-    7040.000000,
-    7458.620184,
-    7902.132820,
-    8372.018090,
-    8869.844191,
-    9397.272573,
-    9956.063479,
-    10548.081821,
-    11175.303406,
-    11839.821527,
-    12543.853951
-};
-
-inline double getNoteNumberFrequency(int nn) {
-    return notenumfreqs[nn];
-}
\ No newline at end of file
+float notenumfreqs[]={
+    8.175799f,
+    8.661957f,
+    9.177024f,
+    9.722718f,
+    10.300861f,
+    10.913382f,
+    11.562326f,
+    12.249857f,
+    12.978272f,
+    13.750000f,
+    14.567618f,
+    15.433853f,
+    16.351598f,
+    17.323914f,
+    18.354048f,
+    19.445436f,
+    20.601722f,
+    21.826764f,
+    23.124651f,
+    24.499715f,
+    25.956544f,
+    27.500000f,
+    29.135235f,
+    30.867706f,
+    32.703196f,
+    34.647829f,
+    36.708096f,
+    38.890873f,
+    41.203445f,
+    43.653529f,
+    46.249303f,
+    48.999429f,
+    51.913087f,
+    55.000000f,
+    58.270470f,
+    61.735413f,
+    65.406391f,
+    69.295658f,
+    73.416192f,
+    77.781746f,
+    82.406889f,
+    87.307058f,
+    92.498606f,
+    97.998859f,
+    103.826174f,
+    110.000000f,
+    116.540940f,
+    123.470825f,
+    130.812783f,
+    138.591315f,
+    146.832384f,
+    155.563492f,
+    164.813778f,
+    174.614116f,
+    184.997211f,
+    195.997718f,
+    207.652349f,
+    220.000000f,
+    233.081881f,
+    246.941651f,
+    261.625565f,
+    277.182631f,
+    293.664768f,
+    311.126984f,
+    329.627557f,
+    349.228231f,
+    369.994423f,
+    391.995436f,
+    415.304698f,
+    440.000000f,
+    466.163762f,
+    493.883301f,
+    523.251131f,
+    554.365262f,
+    587.329536f,
+    622.253967f,
+    659.255114f,
+    698.456463f,
+    739.988845f,
+    783.990872f,
+    830.609395f,
+    880.000000f,
+    932.327523f,
+    987.766603f,
+    1046.502261f,
+    1108.730524f,
+    1174.659072f,
+    1244.507935f,
+    1318.510228f,
+    1396.912926f,
+    1479.977691f,
+    1567.981744f,
+    1661.218790f,
+    1760.000000f,
+    1864.655046f,
+    1975.533205f,
+    2093.004522f,
+    2217.461048f,
+    2349.318143f,
+    2489.015870f,
+    2637.020455f,
+    2793.825851f,
+    2959.955382f,
+    3135.963488f,
+    3322.437581f,
+    3520.000000f,
+    3729.310092f,
+    3951.066410f,
+    4186.009045f,
+    4434.922096f,
+    4698.636287f,
+    4978.031740f,
+    5274.040911f,
+    5587.651703f,
+    5919.910763f,
+    6271.926976f,
+    6644.875161f,
+    7040.000000f,
+    7458.620184f,
+    7902.132820f,
+    8372.018090f,
+    8869.844191f,
+    9397.272573f,
+    9956.063479f,
+    10548.081821f,
+    11175.303406f,
+    11839.821527f,
+    12543.853951f
+};
\ No newline at end of file