ちょっと詰まったのでメモ
※ Macのみ
Midi設定
IAC Driverをonlineにする。
これが、ProcessingとLogicの橋渡しをしてくれる。
Logic Pro X
- 新規トラックを作成
- 新規MIDI出力でIACDriverっぽいものを出力に設定して作成
- 再生して、MIDIが出力されてるっぽいことを確認。
processing
MidiBusを使う。
consoleに IACDriverっぽい名前のやつがあれば成功。
import themidibus.*;
MidiBus myBus;
void setup() {
MidiBus.list();
myBus = new MidiBus(this, 0, 1);
}
void draw() {
int channel = 0;
int pitch = 64;
int velocity = 127;
// Send a Midi noteOn
myBus.sendNoteOn(channel, pitch, velocity);
}
void noteOn(int channel, int pitch, int velocity) {
// Receive a noteOn
println("on: "+pitch);
}
void noteOff(int channel, int pitch, int velocity) {
// Receive a noteOff
println("off: "+pitch);
}
void controllerChange(int channel, int number, int value) {
// Receive a controllerChange
}
Logic以外でもおんなじ感じでイケルと思う。
※ MacOS 10.11.5
※ 32bitOSだとmmjをインストールしないといけないかも。