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@7:439c57c20593, 2014-12-29 (annotated)
- Committer:
- kb10uy
- Date:
- Mon Dec 29 02:34:12 2014 +0000
- Revision:
- 7:439c57c20593
- Child:
- 9:12a54d2ea8fc
Operator?????
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 | 7:439c57c20593 | 9 | FMOperator(Timer tm, AOTTrigon t); |
kb10uy | 7:439c57c20593 | 10 | float calculate(float fmIn); |
kb10uy | 7:439c57c20593 | 11 | float attackNote(float freq); |
kb10uy | 7:439c57c20593 | 12 | float releaseNote(); |
kb10uy | 7:439c57c20593 | 13 | |
kb10uy | 7:439c57c20593 | 14 | float attack; |
kb10uy | 7:439c57c20593 | 15 | float delay; |
kb10uy | 7:439c57c20593 | 16 | float sustain; |
kb10uy | 7:439c57c20593 | 17 | float sustainRate; |
kb10uy | 7:439c57c20593 | 18 | float release; |
kb10uy | 7:439c57c20593 | 19 | |
kb10uy | 7:439c57c20593 | 20 | float frequencyMultiple; |
kb10uy | 7:439c57c20593 | 21 | float totalLevel; |
kb10uy | 7:439c57c20593 | 22 | |
kb10uy | 7:439c57c20593 | 23 | private: |
kb10uy | 7:439c57c20593 | 24 | Timer master; |
kb10uy | 7:439c57c20593 | 25 | AOTTrigon tri; |
kb10uy | 7:439c57c20593 | 26 | //時間だけdouble確保 |
kb10uy | 7:439c57c20593 | 27 | double startTime; |
kb10uy | 7:439c57c20593 | 28 | double releaseTime; |
kb10uy | 7:439c57c20593 | 29 | double baseFrequency; |
kb10uy | 7:439c57c20593 | 30 | }; |