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で。

MIDIUtil.cpp

Committer:
kb10uy
Date:
2014-12-29
Revision:
7:439c57c20593
Child:
10:0ffdefe75566

File content as of revision 7:439c57c20593:


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];
}