Home > mi.el

mi.el

Mi.el is a project mainly written in ..., it's free.

Emacs MIDI Instrument

mi --- Emacs MIDI Instrument

EmacsからMIDIを操作します。

Emacs Lispなので、無理な演奏させるとテンポが狂ったりします。 なのでSchemeで作り直し中。

MIDIのみなので、音は別に用意しないといけません。 Mac OS Xでは内蔵のシンセが使えます。

参考: Impromptu: Scheme ベースのライブコーディング環境 - Radium Software, impromputu

Install

midiator( http://github.com/bleything/midiator )をインストール

$ gem install midiator

.emacsに追記

(require 'mi)
(setq mi-use-dls-synth t) ;; OSXの内蔵シンセを使う場合

Summary

scratchバッファ等でM-x mi-setupするとmiのプロセスが起動します。

S式で記述しC-x C-eeval-last-sexpすることで音を鳴らします。

4オクターブ目(キーボード中央)のドが1拍鳴ります。

(mi-play 60)

シンボルで音を指定できます。

(mi-play 'C4)

複数の音をリストで指定し和音を表現。

(mi-play '(C4 E4 G4))

第二引数は遅延です。指定した拍数の後で鳴らします(ドーミーソー)。

(progn
  (mi-play 'C4 0)
  (mi-play 'E4 1)
  (mi-play 'G4 2))

二小節のドラムシーケンスマクロ。

(mi-seq 1/8
    (crash-cymbal1 x--- ---- ---- ----)
    (closed-hi-hat --x- x-x- x-x- x-x-)
    (snare-drum1   --x- --x- --x- --x-)
    (bass-drum1    x--- xx-- x--x -x--))

M-x mi-destroyでプロセスを終了させます。

Previous:myproject