hCsound-0.3.1: examples/simple.hs
module Main where
import Sound.Csound
import Control.Monad.Error
main :: IO ()
main = runner "-W -otest.wav test1.csd" >>= reportResult
runner :: String -> IO (Either CsoundError ())
runner args = runCsound (compile args >> perform >> destroy)
reportResult :: Either CsoundError () -> IO ()
reportResult (Right _) = putStrLn ("Csound Ran! " )
reportResult (Left e) = putStrLn ("csound didn't run... " ++ (show e))