packages feed

tidal 1.0.4 → 1.0.5

raw patch · 7 files changed

+32/−7 lines, 7 files

Files

src/Sound/Tidal/Config.hs view
@@ -6,7 +6,8 @@                       cCtrlPort :: Int,                       cFrameTimespan :: Double,                       cTempoAddr :: String,-                      cTempoPort :: Int+                      cTempoPort :: Int,+                      cTempoClientPort :: Int                      }  defaultConfig :: Config@@ -15,5 +16,6 @@                         cCtrlPort = 6010,                         cFrameTimespan = 1/20,                         cTempoAddr = "127.0.0.1",-                        cTempoPort = 9160+                        cTempoPort = 9160,+                        cTempoClientPort = 0 -- choose at random                        }
src/Sound/Tidal/Stream.hs view
@@ -31,6 +31,7 @@                       sListenTid :: Maybe ThreadId,                       sPMapMV :: MVar PlayMap,                       sTempoMV :: MVar T.Tempo,+                      sGlobalFMV :: MVar (ControlPattern -> ControlPattern),                       sTarget :: OSCTarget,                       sUDP :: O.UDP                      }@@ -231,9 +232,15 @@ streamUnmuteAll s = do modifyMVar_ (sPMapMV s) $ return . fmap (\x -> x {mute = False})                        calcOutput s ++streamAll :: Stream -> (ControlPattern -> ControlPattern) -> IO ()+streamAll s f = do _ <- swapMVar (sGlobalFMV s) f+                   calcOutput s+ calcOutput :: Stream -> IO () calcOutput s = do pMap <- readMVar $ sPMapMV s-                  _ <- swapMVar (sOutput s) $ toPat pMap+                  globalF <- (readMVar $ sGlobalFMV s)+                  _ <- swapMVar (sOutput s) $ globalF $ toPat $ pMap                   return ()   where toPat pMap =           stack $ map pattern $ filter (\pState -> if hasSolo pMap@@ -247,15 +254,18 @@      listenTid <- ctrlListen cMapMV config      (pMV, tempoMV, u) <- startStream config cMapMV target      pMapMV <- newMVar Map.empty+     globalFMV <- newMVar id      return $ Stream {sConfig = config,                       sInput = cMapMV,                       sListenTid = listenTid,                       sOutput = pMV,                       sPMapMV = pMapMV,                       sTempoMV = tempoMV,+                      sGlobalFMV = globalFMV,                       sTarget = target,                       sUDP = u                      }+ ctrlListen :: MVar ControlMap -> Config -> IO (Maybe ThreadId) ctrlListen cMapMV c   | cCtrlListen c = do putStrLn $ "Listening for controls on " ++ cCtrlAddr c ++ ":" ++ show (cCtrlPort c)
src/Sound/Tidal/Tempo.hs view
@@ -113,10 +113,11 @@ clientListen :: Config -> O.Time -> IO (MVar Tempo, ThreadId) clientListen config s =   do -- Listen on random port-     local <- O.udpServer "127.0.0.1" 0-     let hostname = cTempoAddr config+     let tempoClientPort = cTempoClientPort config+         hostname = cTempoAddr config          port = cTempoPort config      (remote_addr:_) <- N.getAddrInfo Nothing (Just hostname) Nothing+     local <- O.udpServer "127.0.0.1" tempoClientPort      let (N.SockAddrInet _ a) = N.addrAddress remote_addr          remote = N.SockAddrInet (fromIntegral port) (a)          t = defaultTempo s local remote
src/Sound/Tidal/UI.hs view
@@ -1544,6 +1544,13 @@ select = tParam _select  +-- | chooses between a list of functions, using a pattern of floats (from 0-1)+selectF :: Pattern Double -> [Pattern a -> Pattern a] -> Pattern a -> Pattern a+selectF pf ps p = innerJoin $ (\f -> _selectF f ps p) <$> pf++_selectF :: Double -> [Pattern a -> Pattern a] -> Pattern a -> Pattern a+_selectF f ps p =  (ps !! (floor $ (max 0 $ min 0.999999 f) * (fromIntegral $ length ps))) p+ -- | @contrast p f f' p'@ splits controlpattern @p'@ in two, applying -- the function @f@ to one and @f'@ to the other. This depends on -- whether events in it contains values matching with those in @p@.@@ -1654,3 +1661,7 @@                | otherwise = fromRational $ (eventPartStart e - wholeStart e) / (delta' $ whole e)             delta' a = stop a - start a     monoP = mono p++-- | Looks up values from a list of tuples, in order to swap values in the given pattern+swap :: Eq a => [(a, b)] -> Pattern a -> Pattern b+swap things p = filterJust $ (\x -> lookup x things) <$> p
test/Sound/Tidal/ParseTest.hs view
@@ -66,4 +66,3 @@         compareP (Arc 0 2)           ("cp(5,c)" :: Pattern String)           (silence)-
tidal.cabal view
@@ -1,5 +1,5 @@ name:                tidal-version:             1.0.4+version:             1.0.5 synopsis:            Pattern language for improvised music -- description: homepage:            http://tidalcycles.org/
tidal.el view
@@ -104,6 +104,8 @@     once = streamOnce tidal False     asap = streamOnce tidal True     nudgeAll = streamNudgeAll tidal+    all = streamAll tidal+    resetCycles = streamResetCycles tidal     setcps = asap . cps     xfade = transition tidal (Sound.Tidal.Transition.xfadeIn 4)     xfadeIn t = transition tidal (Sound.Tidal.Transition.xfadeIn t)