Created
April 23, 2014 13:37
-
-
Save kindohm/11215494 to your computer and use it in GitHub Desktop.
Python and Haskell code for recording a 1-min Tidal loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Play where | |
import Control.Applicative | |
import Control.Concurrent | |
import Control.Monad | |
import Data.List | |
import Data.Ratio | |
import Sound.Tidal.Dirt | |
import Sound.Tidal.Parse | |
import Sound.Tidal.Pattern | |
import Sound.Tidal.Stream | |
import Sound.Tidal.Strategies | |
import Sound.Tidal.Tempo | |
delay = 60 | |
main :: IO () | |
main = do dirt <- dirtstream "dirt" | |
dirt $ code | |
threadDelay $ delay * 1000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
code = raw_input('tidal> ') | |
fin = open('Play.hs', 'r') | |
fout = open('Code.hs', 'w') | |
header = fin.read() | |
fout.write(header) | |
fout.write("\n\n"); | |
fout.write("code = " + code + "\n") | |
fin.close() | |
fout.close() | |
os.system("ecasound -t:62 -i jack,dirt -o cycle.wav &") | |
os.system("runhaskell Code.hs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment