LoginSignup
6
4

More than 5 years have passed since last update.

LogicとProcessing間でMIDI送受信

Last updated at Posted at 2016-07-17

ちょっと詰まったのでメモ

※ Macのみ

Midi設定

Screen Shot 2016-07-17 at 17.31.52.png

IAC Driverをonlineにする。
これが、ProcessingとLogicの橋渡しをしてくれる。

Logic Pro X

  1. 新規トラックを作成
  2. 新規MIDI出力でIACDriverっぽいものを出力に設定して作成
  3. 再生して、MIDIが出力されてるっぽいことを確認。

Screen Shot 2016-07-17 at 17.37.08.png

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をインストールしないといけないかも。

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4