Skip to content

Commit

Permalink
merge up midi stuff from 0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed May 21, 2016
1 parent feb7499 commit 2411c2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Sound/Tidal/Stream.hs
Expand Up @@ -22,7 +22,8 @@ import qualified Data.Map as Map
type ToMessageFunc = Shape -> Tempo -> Int -> (Double, ParamMap) -> Maybe (IO ())

data Backend a = Backend {
toMessage :: ToMessageFunc
toMessage :: ToMessageFunc,
flush :: Shape -> Tempo -> Int -> IO ()
}

data Param = S {name :: String, sDefault :: Maybe String}
Expand Down Expand Up @@ -137,6 +138,7 @@ onTick backend shape patternM change ticks
(toMessage backend shape change ticks)
(seqToRelOnsets (a, b) p)
E.catch (sequence_ messages) (\msg -> putStrLn $ "oops " ++ show (msg :: E.SomeException))
flush backend shape change ticks
return ()

-- Variant where mutable variable contains list as history of the patterns
Expand All @@ -151,6 +153,7 @@ onTick' backend shape patternsM change ticks
(toM shape change ticks)
(seqToRelOnsets (a, b) $ fst ps)
E.catch (sequence_ messages) (\msg -> putStrLn $ "oops " ++ show (msg :: E.SomeException))
flush backend shape change ticks
return ()

make :: (a -> Value) -> Shape -> String -> Pattern a -> ParamPattern
Expand Down
2 changes: 1 addition & 1 deletion Sound/Tidal/SuperCollider.hs
Expand Up @@ -25,7 +25,7 @@ scSlang n = OscSlang {

scBackend n = do
s <- makeConnection "127.0.0.1" 57110 (scSlang n)
return $ Backend s
return $ Backend s (\_ _ _ -> return ())

scStream n ps l = do let shape = (supercollider ps l)
backend <- scBackend n
Expand Down

0 comments on commit 2411c2e

Please sign in to comment.