Installing symfonion on MacOSX
Symfonion is a JSON based language to create music works. It takes a JSON file as input and outputs a midi file or plays it on the fly.
Today, I installed it on my Macbook Air and would like to share the steps.
1. Install Java
Download Java from here And follow the steps described here if you don't have it yet.
2. Install symfonion binary
Download symfonion binary from here
Place it under /opt/local/bin
.
$ sudo mv symfonion-0.8.10.jar /opt/local/bin/
3. Create a shell to run symfonion
Create a file named /opt/local/bin/symfonion
.
#!/bin/bash java -jar /opt/local/bin/symfonion-0.8.10.jar $@
And change the permission to 755
.
$ sudo chmod 755 /opt/local/bin/symfonion
4. Done!
If you have installed symfonion
successfully, you will see the output below when you type symfonion
from a shell.
nikephoros:Music hiroshi$ symfonion usage: SYNTAX -c,--compile <arg> compile the specified file to a standard midi file. -h,--help print the command line usage. -I <arg> specify midi in port. -l,--list list the available midi devices. -o <arg> specify a file to which a compiled standard midi file is output. -O <arg> specify midi out port. -p,--play <arg> play the specifiled file. -r,--route run a midi patch bay. -V,--version print the version information. nikephoros:Music hiroshi$
あるCPUメーカーのサウンドロゴ。
インテル(TM)、入ってる♪
今では音響商標というものが登録できるそうで、EUでは以下の楽譜がインテルの商標として登録されているそうだ。(欧州共同体商標登録第4610986号)
さて、これのacoustic
のパートをsymfonionで表現してみよう。ファイル名はintel.jsとでもつけて欲しい。
{ "$settings":{ }, "$parts":{ "piano":{"$channel":0, "$volume":120 } }, "$patterns":{ "acoustic":{ "$body":[ {"$notes":"Db>++", "$length":"4"}, {"$notes":"", "$length":"4"}, {"$notes":"", "$length":"8"}, {"$notes":"BbDb>", "$length":"8"}, {"$notes":"DbGb>", "$length":"8"}, {"$notes":"GbDb>", "$length":"8"}, {"$notes":"DbAb>+", "$length":"1"} ], "$velocitybase":120 } }, "$sequence":[ { "$beats":"8/4", "$patterns":{ "piano":["acoustic"] } } ] }
演奏は例によって以下の感じ。
$ symfonion intel.js
今回少しだけ気をつけて欲しいのは、$sequence
の下にある$beats
の部分。値が8/4
となっている。
$sequence
は、配列内の要素を順々に演奏していくためのキーワードだが、各要素の長さがそれぞれ何拍子分演奏されるかは$beats
で指定されるのだ。ここには8/4
と書かれているので、四分音符が8個分演奏されることになる。4/4
とかって書いてしまうと、演奏されるべき楽譜が2小節分(=四分音符が8個分)あるので、途中で切れてしまうのだ。