この記事は古くなりました。田所先生の授業資料をご参照ください(勝手にリンクしました。。。) ⇒ yoppa.org
長い前置きなんてどーでもいいから結論はどこ?という方は一番下の「■結論」をみてくださいね。
MBA11インチ(2013年購入)を使い続けてきましたが、さすがにバッテリーがダメ(それでも何度か交換したんですが)。
で、2週間ほど前に納品されまして新MBAに移行していました。
これまでTime Machineで自動移行?していたのですが、今回はゴミを排除したいということで、手動でセットアップすることにしました。
アプリはほぼすべて入れ終えて、作業ファイルも移行し終えました。
あとは、何か問題があれば、そのときに都度、入れていこうかという状況です。
で、やっとタイトル。
tidalcyclesのセットアップをしました。
AtomとSuperColliderは既にインストールしていたのですが、tidalcyclesのセットアップは時間ができてから。。。ということで後回しでした。
で、本日、講義後に作業してみたところ。。。2,3時間くらいかかってしまいました。
Haskellはstackでいれるべき、とか見かけまして、それでいれても動かず(正確には音がでない)。
Haskellはほとんど知識がありませんので、以下のトレースをしました。
TidalCyclesをstackで確実にインストールする - Haskell-jp
表立ってエラーは出ないようなのですが、Atomで「d1 $ sound "bd sd"」とやると、下のログウィンドウ?に以下のようなエラーメッセージが表示されます。
t>
: error:
Could not find module ‘Sound.Tidal.Context’
It is not a module in the current program, or in any known package.
Not in scope: ‘oLatency’
Not in scope: ‘oAddress’
Not in scope: ‘oPort’
Not in scope: ‘cFrameTimespan’
Not in scope: ‘Sound.Tidal.Transition.xfadeIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.xfadeIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.histpan’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.wait’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.waitT’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.jump’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.jumpIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.jumpIn'’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.jumpMod’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.mortal’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.interpolate’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.interpolateIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.clutch’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.clutchIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.anticipate’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.anticipateIn’
No module named ‘Sound.Tidal.Transition’ is imported.
Not in scope: ‘Sound.Tidal.Transition.mortalOverlay’
No module named ‘Sound.Tidal.Transition’ is imported.
Variable not in scope: streamSetI :: t4 -> t
Variable not in scope: tidal
Variable not in scope: streamSetF :: t3 -> t
Variable not in scope: tidal
Variable not in scope: streamSetS :: t2 -> t
Variable not in scope: tidal
Variable not in scope: streamSetI :: t1 -> t
Variable not in scope: tidal
Variable not in scope: streamSetB :: t0 -> t
Variable not in scope: tidal
Variable not in scope: d1 :: t0 -> t
• Variable not in scope: sound :: [Char] -> t0
• Perhaps you meant ‘round’ (imported from Prelude)
私はHaskell使いではないので、エラーの解釈はできませんが、たぶん、Sound.Tidal.Contextなどのライブラリがインストール失敗しているっぽいんですね。
これって、上の手順書?で「stack build tidal」と入力したときに、インストールされるものなのですが、たしかにログをみるとエラー(というかワーニングが)があるみたい。
Haskellのバージョンが古い方がいいのか。。。いろいろと想像しました。
ここまでで2、3時間くらい経過していました。
ふと、「移行前のMacでは使えていたし、どうなったっけ?」とみると、なぜか以前のMacでも上記のエラーが出て音がなりません。
おいおい。。。
そこで、以下のコマンドを実行してtidalのライブラリ?を再度インストールしてみました。
cabal install tidal --lib
そーしたら、鳴ったわけです。
ってことは、よくわからないけど、haskellをフツーにいれて、cabalでインストールすれば動きそうだな、と結論に至ったわけです。
で、まとめるとMacでのTidalCyclesを動作させるために必要なHaskell周りの手順は以下の通りです。
■結論
以下を実行する前にhomebrewはインストールしておいてくださいね。インストール方法はこちら
brew install ghc brew install cabal-install cabal update cabal install tidal --lib
ちなみにこれでインストールされるバージョンはそれぞれ以下のようです。参考まで。
ghc 8.8.1
cabal 3.0.0.0
tidal-1.4.3
brewでインストールするので、特にhaskellのツールの使い方とか覚えなくていいし、いらなくなったら削除も容易なのでこれでいいんじゃないですかね?
この他は、以下でしょうか。
- atomをインストールする
- atomの中でtidalcycles 3.1.0のパッケージをインストールする
- SuperColliderをインストールする
- SuperColliderを起動して、include("SuperDirt")と入力したあと、⌘+Enter、その後、LanguageメニューからRecompile Class Libraryを実行する
- Fileメニューからopen startup fileを選択して、そこにSuperDirt.startと書いて保存しておく。
準備ができたら、Atomを起動して、新規ファイル作成し、.tidalでファイル保存してからおもむろに「d1 $ sound "bd sd"」と入力し⌘+Enterで音が再生されれば環境構築完了ですね。
ほんと時代の流れが早い。。。ちょっと気を抜くと手順が使えなくなる時代です。大変です。ITは。