Nucleo F401REでFM音源を実装するやつ 外部DACとオペアンプを利用 現在はMCP4922とNJM2737
Dependencies: AOTTrigon I2CEEPROM MCP4922 AQM0802A mbed
Fork of NuMidi401 by
NuFM401
Nucleo F401用の自作ソフトウェアMIDI音源
概要
だいたいそんなもんです。
特徴
- ブレッドボードの上で組める程度には簡単な回路構成
- 外部のDACにMCP4922を採用
- 念のためのボルテージフォロアとしてNJM2737Dを採用
- バンク用EEPROMに24FC1025を採用
- シリアル経由でMIDIデータを受信することで操作
補足
シリアル <=> MIDI のドライバにはHairless-MIDISerialをオススメします。 仮想MIDIケーブルはとりあえずMIDI Yokeで。
Operator.h@10:0ffdefe75566, 2014-12-29 (annotated)
- Committer:
- kb10uy
- Date:
- Mon Dec 29 09:01:10 2014 +0000
- Revision:
- 10:0ffdefe75566
- Parent:
- 9:12a54d2ea8fc
- Child:
- 12:7408b85fba39
MIDI?????USBMIDI????Serial????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kb10uy | 7:439c57c20593 | 1 | #pragma once |
kb10uy | 7:439c57c20593 | 2 | #include "mbed.h" |
kb10uy | 7:439c57c20593 | 3 | #include "AOTTrigon.h" |
kb10uy | 7:439c57c20593 | 4 | |
kb10uy | 7:439c57c20593 | 5 | |
kb10uy | 7:439c57c20593 | 6 | class FMOperator { |
kb10uy | 7:439c57c20593 | 7 | |
kb10uy | 7:439c57c20593 | 8 | public: |
kb10uy | 10:0ffdefe75566 | 9 | FMOperator(); |
kb10uy | 9:12a54d2ea8fc | 10 | FMOperator(Timer *tm, AOTTrigon *t); |
kb10uy | 7:439c57c20593 | 11 | float calculate(float fmIn); |
kb10uy | 9:12a54d2ea8fc | 12 | void attackNote(float freq); |
kb10uy | 9:12a54d2ea8fc | 13 | void releaseNote(); |
kb10uy | 7:439c57c20593 | 14 | |
kb10uy | 7:439c57c20593 | 15 | float attack; |
kb10uy | 7:439c57c20593 | 16 | float delay; |
kb10uy | 7:439c57c20593 | 17 | float sustain; |
kb10uy | 7:439c57c20593 | 18 | float sustainRate; |
kb10uy | 7:439c57c20593 | 19 | float release; |
kb10uy | 7:439c57c20593 | 20 | |
kb10uy | 7:439c57c20593 | 21 | float frequencyMultiple; |
kb10uy | 7:439c57c20593 | 22 | float totalLevel; |
kb10uy | 7:439c57c20593 | 23 | |
kb10uy | 7:439c57c20593 | 24 | private: |
kb10uy | 9:12a54d2ea8fc | 25 | Timer *master; |
kb10uy | 9:12a54d2ea8fc | 26 | AOTTrigon *tri; |
kb10uy | 7:439c57c20593 | 27 | //時間だけdouble確保 |
kb10uy | 7:439c57c20593 | 28 | double startTime; |
kb10uy | 7:439c57c20593 | 29 | double releaseTime; |
kb10uy | 7:439c57c20593 | 30 | double baseFrequency; |
kb10uy | 7:439c57c20593 | 31 | }; |