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で。
FMOscillator/FMAlgorithm.cpp@20:8278e607a687, 2015-01-29 (annotated)
- Committer:
- kb10uy
- Date:
- Thu Jan 29 11:09:56 2015 +0000
- Revision:
- 20:8278e607a687
- Parent:
- 19:f0dcf591c5dd
- Child:
- 21:e3014c1bdf9c
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kb10uy | 19:f0dcf591c5dd | 1 | #include "FMAlgorithm.h" |
kb10uy | 19:f0dcf591c5dd | 2 | |
kb10uy | 19:f0dcf591c5dd | 3 | FMAlgorithm::FMAlgorithm() |
kb10uy | 19:f0dcf591c5dd | 4 | { |
kb10uy | 19:f0dcf591c5dd | 5 | opcount = 0; |
kb10uy | 19:f0dcf591c5dd | 6 | cncount = 0; |
kb10uy | 19:f0dcf591c5dd | 7 | operators = NULL; |
kb10uy | 19:f0dcf591c5dd | 8 | connections = NULL; |
kb10uy | 19:f0dcf591c5dd | 9 | } |
kb10uy | 19:f0dcf591c5dd | 10 | |
kb10uy | 19:f0dcf591c5dd | 11 | FMAlgorithm::FMAlgorithm(int opc, int cnc) |
kb10uy | 19:f0dcf591c5dd | 12 | { |
kb10uy | 19:f0dcf591c5dd | 13 | opcount = opc; |
kb10uy | 19:f0dcf591c5dd | 14 | cncount = cnc; |
kb10uy | 19:f0dcf591c5dd | 15 | operators = new FMOperator*[opcount]; |
kb10uy | 19:f0dcf591c5dd | 16 | connections = new FMAlgorithmConnection[cncount]; |
kb10uy | 19:f0dcf591c5dd | 17 | } |
kb10uy | 19:f0dcf591c5dd | 18 | |
kb10uy | 19:f0dcf591c5dd | 19 | FMAlgorithm::~FMAlgorithm() |
kb10uy | 19:f0dcf591c5dd | 20 | { |
kb10uy | 19:f0dcf591c5dd | 21 | if (operators != NULL) delete[] operators; |
kb10uy | 19:f0dcf591c5dd | 22 | if (connections != NULL) delete[] connections; |
kb10uy | 19:f0dcf591c5dd | 23 | } |
kb10uy | 19:f0dcf591c5dd | 24 | |
kb10uy | 19:f0dcf591c5dd | 25 | void FMAlgorithm::setOperator(int num, FMOperator *op) |
kb10uy | 19:f0dcf591c5dd | 26 | { |
kb10uy | 19:f0dcf591c5dd | 27 | if (num >= opcount) return; |
kb10uy | 19:f0dcf591c5dd | 28 | operators[num] = op; |
kb10uy | 19:f0dcf591c5dd | 29 | } |
kb10uy | 19:f0dcf591c5dd | 30 | |
kb10uy | 19:f0dcf591c5dd | 31 | void FMAlgorithm::setConnection(int num, int t, int s) |
kb10uy | 19:f0dcf591c5dd | 32 | { |
kb10uy | 19:f0dcf591c5dd | 33 | if (num >= cncount) return; |
kb10uy | 19:f0dcf591c5dd | 34 | connections[num].target = t; |
kb10uy | 19:f0dcf591c5dd | 35 | connections[num].source = s; |
kb10uy | 20:8278e607a687 | 36 | } |