この文書の現在のバージョンと選択したバージョンの差分を表示します。
次のリビジョン | 前のリビジョン 次のリビジョン 両方とも次のリビジョン | ||
usb_midi_controller:arduino_midi_controller [2018/03/31 02:02] fifi 作成 |
usb_midi_controller:arduino_midi_controller [2018/04/21 02:18] fifi |
||
---|---|---|---|
ライン 3: | ライン 3: | ||
すごい参考になる資料 https://www.slideshare.net/tadfmac/arduinomidi | すごい参考になる資料 https://www.slideshare.net/tadfmac/arduinomidi | ||
MOCOの焼き方が書かれている | MOCOの焼き方が書かれている | ||
+ | |||
+ | # pitch bendエラーの原因が分かった | ||
+ | おそらく | ||
+ | ``` | ||
+ | Serial.begin(9600); | ||
+ | ``` | ||
+ | のせいで異なるフォーマットで通信していた可能性がある | ||
+ | |||
+ | |||
+ | # Arduino Midi Librari リファレンス | ||
+ | ソースコード : | ||
+ | http://arduinomidilib.sourceforge.net/a00001.html#ac34d163205bb01ac5e03df7e64facebe | ||
+ | |||
+ | ソースコード sendControlChange : http://arduinomidilib.sourceforge.net/a00001.html#a3a80e9bd2cfdb619be91d80e8f3b7825 | ||
+ | |||
+ | なぜかMIDI.send***は使い物にならない | ||
+ | ↓を参考に: サンプルコード | ||
+ | http://forum.arduino.cc/index.php?topic=293460.0 | ||
+ | |||
+ | ``` | ||
+ | #include <MIDI.h> | ||
+ | #include <midi_Defs.h> | ||
+ | #include <midi_Message.h> | ||
+ | #include <midi_Namespace.h> | ||
+ | #include <midi_Settings.h> | ||
+ | |||
+ | //http://forum.arduino.cc/index.php?topic=293460.0 | ||
+ | |||
+ | MIDI_CREATE_DEFAULT_INSTANCE(); | ||
+ | |||
+ | void setup() { | ||
+ | MIDI.begin(); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | for(int i=0; i<128; i++){ | ||
+ | for(int j=0; j<128; j++){ | ||
+ | for(int c=1; c<17; c++){ | ||
+ | MIDI.send(midi::ControlChange, i, j, c); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ``` | ||
+ | |||
+ | ### 使い方 | ||
+ | |||
+ | Ch: 1 (固定) | ||
+ | Controller : potにより変更 | ||
+ | Value : pot 0-127, (btn 0 or 127) | ||