Arduino MIDI Slider PWM Waveform Generator
This is a short update, to demonstrate the MIDI version of my Arduino Slider PWM Waveform Generator.
A future project shows a similar system using an R2R ladder.
https://youtu.be/chMNcMcGbXY
これらは、このプロジェクトで使用されている主なコンセプトに関する主要なプロジェクトです:
These are the key projects for the main concepts used in this project:
If you are new to Arduino, see the Getting Started pages.
code:部品リスト
・Arduino Uno
・マルチプレクスされた16ポットスライダー/フェーダーボード(Arduino Multi-Slider MIDI Controller – Part 3で説明されているもの)
・Arduino PWM出力フィルタ回路(オプションだが推奨)
・アンプおよびスピーカー
・MIDI入力インターフェース(Ready-Made MIDI Modulesなどの市販モジュール)
・ブレッドボードおよびジャンパーワイヤー
Parts list
Arduino Uno
Amplification and speaker
Breadboard and jumper wires
回路
The Circuit
https://gyazo.com/d38381a9f4ba0c54d9b1ba4486575ff9
コード
コードはすでにMIDI対応済みでした。有効にするには、シリアル出力を無効にし、テストトーンをオフにする必要があります。ファイルの先頭にあるTEST定義をコメントアウトするだけでOKです!
code:code
//#define TEST 1
The Code
The code was already MIDI “ready to go”. To enable it, the serial output has to be disabled and the test tone turned off. Just commenting out the TEST definition at the top of the file will do it!
//#define TEST 1
Find the original on GitHub here.
締めくくりの考察
MIDIの処理はややシンプルですが、概ね問題なく動作します。最適化できる点はいくつかあると思います。周波数更新のコードは「Arduino MIDI R2R Digital Audio」から引き継いだもので、私がいじっているうちにまだ調整中です。いつかきちんと腰を据えて、この部分をどう動作させたいかを決める必要があります。
何らかのディスプレイを追加することも検討していますが、コア機能自体は変わらないので、実際に取りかかるかどうかはわかりません。でも、あれば便利でしょう。
また、PWMではなくR2R出力を使ったバージョンを作るのも良いかもしれません。ただ、その場合はもう一つR2Rシールドを作る必要があるかもしれません。というのも、私のオリジナルのシールドはまだLo-Fi Orchestraで使っているからです。
Closing Thoughts
The MIDI handling is somewhat simplistic, but it generally works. There are a number of optimisations that I’m sure I could do. I inherited the “frequency updating” code from Arduino MIDI R2R Digital Audio which itself is still getting tweaked as I tinker with it. One day I need to sit down and properly decide how I want that to work.
I am still considering how to add some kind of display, but I don’t know if I’ll actually get around to doing that or not, as it doesn’t really change the core functionality. But it would be nice.
It might also be quite nice to do a version of this with an R2R output rather than PWM, but that might need me to make another R2R shield as my original one is still in the Lo-Fi Orchestra!