packages feed

hCsound-0.3.1: examples/test2.hs

module Main where

import           Sound.Csound
import qualified Data.Vector.Storable as V

main :: IO ()
main = runCsound (runner "-W -o test2.wav test1.csd")
  >>= either print (const $ print "ok")

runner :: String -> Csound ()
runner args = do
  setHostImplementedAudioIO 1 512
  compile args
  performKsmpsIO (\x _ -> return $ V.replicate x 1) (\_ _ _ -> return () )