tidal 0.4.21 → 0.4.23
raw patch · 8 files changed
+57/−26 lines, 8 filesdep +alsa-coredep +alsa-seq
Dependencies added: alsa-core, alsa-seq
Files
- README.md +4/−7
- Sound/Tidal/Dirt.hs +6/−5
- Sound/Tidal/Pattern.hs +15/−3
- Sound/Tidal/Strategies.hs +11/−0
- Sound/Tidal/Stream.hs +10/−6
- Sound/Tidal/Utils.hs +5/−0
- tidal.cabal +2/−2
- tidal.el +4/−3
README.md view
@@ -3,14 +3,11 @@ Language for live coding of pattern -(c) Alex McLean 2014+For documentation, mailing list and more info see here:+ http://tidal.lurk.org/ +(c) Alex McLean and contributors, 2014+ Distributed under the terms of the GNU Public license version 3 (or later). -See in doc/ for some documentation.--For mailing list and more info see here:- http://yaxu.org/tidal/--alex@slab.org
Sound/Tidal/Dirt.hs view
@@ -46,7 +46,9 @@ F "bandq" (Just 0) ], timestamp = MessageStamp,- latency = 0.04+ latency = 0.04,+ namedParams = False,+ preamble = [] } kriole :: OscShape@@ -55,7 +57,9 @@ F "kpitch" (Just 1) ], timestamp = MessageStamp,- latency = 0.04+ latency = 0.04,+ namedParams = False,+ preamble = [] } dirtstart name = start "127.0.0.1" 7771 dirt@@ -157,6 +161,3 @@ where off i p = p |+| begin ((atom $ (fromIntegral i / fromIntegral n) + o) :: Pattern Double) |+| end ((atom $ (fromIntegral (i+1) / fromIntegral n) + o) :: Pattern Double) metronome = slow 2 $ sound (p "[odx, [hh]*8]")--interlace :: OscPattern -> OscPattern -> OscPattern-interlace a b = weave 16 (shape $ ((* 0.9) <$> sinewave1)) [a, b]
Sound/Tidal/Pattern.hs view
@@ -59,7 +59,7 @@ instance Monad Pattern where return = pure- p >>= f = + p >>= f = -- unwrap (f <$> p) Pattern (\a -> concatMap -- TODO - this is a total guess (\((s,e), (s',e'), x) -> mapSnds' (const (s',e')) $@@ -70,6 +70,18 @@ (arc p a) ) +-- join x = x >>= id+++-- Take a pattern, and function from elements in the pattern to another pattern,+-- and then return that pattern+--bind :: Pattern a -> (a -> Pattern b) -> Pattern b+--bind p f = ++-- this is actually join+unwrap :: Pattern (Pattern a) -> Pattern a+unwrap p = Pattern $ \a -> concatMap ((\p' -> arc p' a) . thd') (arc p a)+ -- | @atom@ is a synonym for @pure@. atom :: a -> Pattern a atom = pure@@ -471,8 +483,8 @@ revArc a = within a rev -e :: Int -> Int -> Pattern b -> Pattern b+e :: Int -> Int -> Pattern a -> Pattern a e n k p = (flip const) <$> (filterValues (== True) $ listToPat $ bjorklund (n,k)) <*> p -e' :: Int -> Int -> Pattern b -> Pattern b+e' :: Int -> Int -> Pattern a -> Pattern a e' n k p = cat $ map (\x -> if x then p else silence) (bjorklund (n,k))
Sound/Tidal/Strategies.hs view
@@ -142,3 +142,14 @@ en :: [(Int, Int)] -> Pattern String -> Pattern String en ns p = stack $ map (\(i, (k, n)) -> e k n (samples p (pure i))) $ enumerate ns++weave :: Rational -> OscPattern -> [OscPattern] -> OscPattern+weave t p ps = weave' t p (map const ps)++weave' :: Rational -> OscPattern -> [OscPattern -> OscPattern] -> OscPattern+weave' t p fs | l == 0 = silence+ | otherwise = slow t $ stack $ map (\(i, f) -> ((density t (f p)) |+| (((fromIntegral i) % l) <~ p))) (zip [0 ..] fs)+ where l = fromIntegral $ length fs++interlace :: OscPattern -> OscPattern -> OscPattern+interlace a b = weave 16 (shape $ ((* 0.9) <$> sinewave1)) [a, b]
Sound/Tidal/Stream.hs view
@@ -16,6 +16,7 @@ import Sound.Tidal.Pattern import qualified Sound.Tidal.Parse as P import Sound.Tidal.Tempo (Tempo, logicalTime, clocked,clockedTick)+import Sound.Tidal.Utils import qualified Data.Map as Map @@ -37,7 +38,9 @@ data OscShape = OscShape {path :: String, params :: [Param], timestamp :: TimeStamp,- latency :: Double+ latency :: Double,+ namedParams :: Bool,+ preamble :: [Datum] } type OscMap = Map.Map Param (Maybe Datum) @@ -82,12 +85,17 @@ logicalOnset = logicalNow + (logicalPeriod * o) + (latency shape) sec = floor logicalOnset usec = floor $ 1000000 * (logicalOnset - (fromIntegral sec))- oscdata = catMaybes $ mapMaybe (\x -> Map.lookup x m') (params shape)+ oscdata = preamble shape ++ (parameterise $ catMaybes $ mapMaybe (\x -> Map.lookup x m') (params shape)) oscdata' = ((int32 sec):(int32 usec):oscdata) osc | timestamp shape == BundleStamp = sendOSC s $ Bundle (ut_to_ntpr logicalOnset) [Message (path shape) oscdata] | timestamp shape == MessageStamp = sendOSC s $ Message (path shape) oscdata' | otherwise = doAt logicalOnset $ sendOSC s $ Message (path shape) oscdata return osc+ where+ parameterise :: [Datum] -> [Datum]+ parameterise ds | namedParams shape =+ mergelists (map (string . name) (params shape)) ds+ | otherwise = ds doAt t action = do forkIO $ do now <- getCurrentTime let nowf = realToFrac $ utcTimeToPOSIXSeconds now@@ -158,9 +166,5 @@ -weave :: Rational -> OscPattern -> [OscPattern] -> OscPattern-weave t p ps | l == 0 = silence- | otherwise = slow t $ stack $ map (\(i, p') -> ((density t p') |+| (((fromIntegral i) % l) <~ p))) (zip [0 ..] ps)- where l = fromIntegral $ length ps
Sound/Tidal/Utils.hs view
@@ -58,3 +58,8 @@ getEnvDefault defValue var = do res <- try . getEnv $ var return $ either (const defValue) id (res :: Either IOException String)++mergelists :: [a] -> [a] -> [a]+mergelists xs [] = xs+mergelists [] ys = ys+mergelists (x:xs) (y:ys) = x : y : mergelists xs ys
tidal.cabal view
@@ -1,5 +1,5 @@ name: tidal-version: 0.4.21+version: 0.4.23 synopsis: Pattern language for improvised music -- description: homepage: http://yaxu.org/tidal/@@ -28,4 +28,4 @@ Sound.Tidal.Context Sound.Tidal.Utils - Build-depends: base < 5, process, parsec, hosc > 0.13, hashable, colour, containers, time, websockets > 0.8, text, mtl >=2.1, transformers, mersenne-random-pure64,binary, bytestring, hmt+ Build-depends: base < 5, process, parsec, hosc > 0.13, hashable, colour, containers, time, websockets > 0.8, text, mtl >=2.1, transformers, mersenne-random-pure64,binary, bytestring, hmt, alsa-seq, alsa-core
tidal.el view
@@ -56,7 +56,8 @@ (tidal-see-output)) (tidal-send-string ":set prompt \"\"") (tidal-send-string "import Sound.Tidal.Context")-; (tidal-send-string "import Sound.Tidal.VolcaKeys")+ (tidal-send-string "import Sound.Tidal.VolcaKeys")+ (tidal-send-string "import Sound.Tidal.Poetry") ; (tidal-send-string "import Volca.Beat") ; (tidal-send-string "import Volca.Key") ; (tidal-send-string "(note, [portamento, expression, voice, octave, detune, vcoegint, kcutoff, vcfegint, lforate, lfopitchint, lfocutoffint, attack, decay, sustain, dtime , dfeedback], keystop) <- keystart")@@ -71,10 +72,10 @@ (tidal-send-string "d8 <- dirtStream") (tidal-send-string "d9 <- dirtStream") (tidal-send-string "d10 <- dirtStream")-; (tidal-send-string "k1 <- keyStream")+ (tidal-send-string "k1 <- keyStream") (tidal-send-string "(cps, getNow) <- bpsUtils") (tidal-send-string "let bps x = cps (x/2)")- (tidal-send-string "let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10]")+ (tidal-send-string "let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,k1]") (tidal-send-string "let solo = (>>) hush") (tidal-send-string ":set prompt \"tidal> \"") )