tidal 0.2.11 → 0.2.13
raw patch · 8 files changed
+53/−40 lines, 8 files
Files
- Sound/Tidal/Dirt.hs +8/−5
- Sound/Tidal/Parse.hs +5/−3
- Sound/Tidal/Strategies.hs +3/−0
- Sound/Tidal/Stream.hs +1/−1
- doc/tidal.md +25/−20
- doc/tidal.pdf binary
- tidal.cabal +1/−1
- tidal.el +10/−10
Sound/Tidal/Dirt.hs view
@@ -34,7 +34,7 @@ F "shape" (Just 0), I "kriole" (Just 0), F "gain" (Just 0),- I "cutgroup" (Just 0)+ I "cut" (Just (0)) ], timestamp = True }@@ -49,7 +49,11 @@ } dirtstart name = start "127.0.0.1" 7771 dirt-dirtstream name = stream "127.0.0.1" 7771 dirt+dirtStream = stream "127.0.0.1" 7771 dirt++-- disused parameter..+dirtstream _ = dirtStream+ kstream name = stream "127.0.0.1" 6040 kriole doubledirt = do remote <- stream "178.77.72.138" 7777 dirt@@ -102,8 +106,8 @@ shape = makeF dirt "shape" gain = makeF dirt "gain" -cutgroup :: Pattern Int -> OscPattern-cutgroup = makeI dirt "cutgroup"+cut :: Pattern Int -> OscPattern+cut = makeI dirt "cut" ksymbol = makeF kriole "ksymbol" kpitch = makeF kriole "kpitch"@@ -122,7 +126,6 @@ striate' n f p = cat $ map (\x -> off (fromIntegral x) p) [0 .. n-1] where off i p = p |+| begin (atom (slot * i) :: Pattern Double) |+| end (atom ((slot * i) + f) :: Pattern Double) slot = (1 - f) / (fromIntegral n)- striateO :: OscPattern -> Int -> Double -> OscPattern striateO p n o = cat $ map (\x -> off (fromIntegral x) p) [0 .. n-1]
Sound/Tidal/Parse.hs view
@@ -51,6 +51,7 @@ angles = P.angles lexer symbol = P.symbol lexer natural = P.natural lexer+integer = P.integer lexer float = P.float lexer naturalOrFloat = P.naturalOrFloat lexer @@ -121,7 +122,7 @@ scale (ps@((n,_):_)) = map (\(n',p) -> density (fromIntegral n/ fromIntegral n') p) ps pString :: Parser (String)-pString = many1 (letter <|> oneOf "0123456789" <|> char '/') <?> "string"+pString = many1 (letter <|> oneOf "0123456789/:") <?> "string" pVocable :: Parser (Pattern String) pVocable = do v <- pString@@ -140,8 +141,9 @@ return $ atom False pInt :: Parser (Pattern Int)-pInt = do i <- natural <?> "integer"- return $ atom (fromIntegral i)+pInt = do s <- sign+ i <- integer <?> "integer"+ return $ atom (applySign s $ fromIntegral i) pColour :: Parser (Pattern ColourD) pColour = do name <- many1 letter <?> "colour name"
Sound/Tidal/Strategies.hs view
@@ -19,6 +19,9 @@ double = echo jux f p = stack [p |+| pan (pure 0), f $ p |+| pan (pure 1)]+juxcut f p = stack [p |+| pan (pure 0) |+| cut (pure (-1)), + f $ p |+| pan (pure 1) |+| cut (pure (-2))+ ] jux4 f p = stack [p |+| pan (pure 0), f $ p |+| pan (pure 2)] superimpose f p = stack [p, f p]
Sound/Tidal/Stream.hs view
@@ -74,7 +74,7 @@ toMessage s shape change ticks (o, m) = do m' <- applyShape' shape m let beat = fromIntegral ticks / fromIntegral tpb- latency = 0.5+ latency = 0.02 logicalNow = (logicalTime change beat) beat' = (fromIntegral ticks + 1) / fromIntegral tpb logicalPeriod = (logicalTime change (beat + 1)) - logicalNow
doc/tidal.md view
@@ -9,7 +9,7 @@ might help to pick up an introduction. You could try Graham Hutton's "Programming in Haskell" or Miran Lipovača's "Learn you a Haskell for Great Good" (which has a free online version). Or, you could just try-learning enough by playing around with Tidal.+learning enough syntax just by playing around with Tidal. # Installation @@ -35,11 +35,17 @@ `"bd"` is a pattern that contains a single sound. `bd` is a sample of a bass drum. To run the code, use `Ctrl-C` then `Ctrl-C`. -We can pick variations of a sound by adding a slash then a number, for-example this picks the fourth bass drum (it starts with 0):+*In case you're wondering, the `$` character in the above is Haskell+syntax, which just means "give the result of the right to the function+on the left". An alternative would have been to do without the `$` by+wrapping everything on the right in parenthesis: `d1 (sound "bd")`* +We can pick variations of a sound by adding a colon (`:`) then a+number, for example this picks the fourth bass drum (it counts from+0, so :3 gives you the fourth sound):+ ~~~~ {#mycode .haskell}-d1 $ sound "bd/3"+d1 $ sound "bd:3" ~~~~ Putting things in quotes actually defines a sequence. For example, the@@ -64,9 +70,8 @@ NOTE: `Ctrl-C Ctrl-C` won't work on the above, because it goes over more than one line. Instead, do `Ctrl-C Ctrl-E` to run the whole-block. However, note that there must be empty lines surrounding the-block. The lines must be completely empty, including of spaces (this-can be annoying as you can't see the spaces).+block. However, note that there must be blank lines surrounding the+block (which also means that patterns cannot contain blank lines). Note that for `pan`, when working in stereo, that `0` means hard left, `1` means hard right, and `0.5` means centre.@@ -173,7 +178,7 @@ wobble drumtraks koy rave bottle kurt latibro rm sax lighter lt Each one is a folder containing one or more wav files. For example-when you put `bd/1` in a sequence, you're picking up the second wav+when you put `bd:1` in a sequence, you're picking up the second wav file in the `bd` folder. If you ask for the ninth sample and there are only seven in the folder, it'll wrap around and play the second one. @@ -429,7 +434,7 @@ Example: ~~~~ {#mycode .haskell}-d1 $ interlace (sound "bd sn kurt") (every 3 rev $ sound "bd sn/2")+d1 $ interlace (sound "bd sn kurt") (every 3 rev $ sound "bd sn:2") ~~~~ # Spread@@ -449,33 +454,33 @@ Taking a simple high hat loop as an example: ~~~~ {#mycode .haskell}-d1 $ sound "ho ho/2 ho/3 hc"+d1 $ sound "ho ho:2 ho:3 hc" ~~~~ We can slow it down by different amounts, such as by a half: ~~~~ {#mycode .haskell}- d1 $ slow 2 $ sound "ho ho/2 ho/3 hc"+ d1 $ slow 2 $ sound "ho ho:2 ho:3 hc" ~~~~ Or by four thirds (i.e. speeding it up by a third; `4%3` means four over three): ~~~~ {#mycode .haskell}- d1 $ slow (4%3) $ sound "ho ho/2 ho/3 hc"+ d1 $ slow (4%3) $ sound "ho ho:2 ho:3 hc" ~~~~ But if we use `spread`, we can make a pattern which alternates between the two speeds: ~~~~ {#mycode .haskell}-d1 $ spread slow [2,4%3] $ sound "ho ho/2 ho/3 hc"+d1 $ spread slow [2,4%3] $ sound "ho ho:2 ho:3 hc" ~~~~ There's a version of this function, `spread'` (pronounced "spread prime"), which takes a *pattern* of parameters, instead of a list: ~~~~ {#mycode .haskell}-d1 $ spread' slow "2 4%3" $ sound "ho ho/2 ho/3 hc"+d1 $ spread' slow "2 4%3" $ sound "ho ho:2 ho:3 hc" ~~~~ This is quite a messy area of Tidal - due to a slight difference of@@ -483,7 +488,7 @@ using `spread'` though is that you can provide polyphonic parameters, e.g.: ~~~~ {#mycode .haskell}-d1 $ spread' slow "[2 4%3, 3]" $ sound "ho ho/2 ho/3 hc"+d1 $ spread' slow "[2 4%3, 3]" $ sound "ho ho:2 ho:3 hc" ~~~~ # Striate@@ -495,7 +500,7 @@ Striate is a kind of granulator, for example: ~~~~ {#mycode .haskell}-d1 $ striate 3 $ sound "ho ho/2 ho/3 hc"+d1 $ striate 3 $ sound "ho ho:2 ho:3 hc" ~~~~ This plays the loop the given number of times, but triggering@@ -539,20 +544,20 @@ So this: ~~~~ {#mycode .haskell}- d1 $ smash 3 [2,3,4] $ sound "ho ho/2 ho/3 hc"+ d1 $ smash 3 [2,3,4] $ sound "ho ho:2 ho:3 hc" ~~~~ Is a bit like this: ~~~~ {#mycode .haskell}- d1 $ spread (slow) [2,3,4] $ striate 3 $ sound "ho ho/2 ho/3 hc"+ d1 $ spread (slow) [2,3,4] $ striate 3 $ sound "ho ho:2 ho:3 hc" ~~~~ This is quite dancehall: ~~~~ {#mycode .haskell} d1 $ (spread' slow "1%4 2 1 3" $ spread (striate) [2,3,4,1] $ sound-"sn/2 sid/3 cp sid/4")+"sn:2 sid:3 cp sid:4") |+| speed "[1 2 1 1]/2" ~~~~ @@ -564,7 +569,7 @@ multiplying the numbers inside them together, like this: ~~~~ {#mycode .haskell}-d1 $ (brak (sound "bd sn/2 bd sn"))+d1 $ (brak (sound "bd sn:2 bd sn")) |+| pan ((*) <$> sinewave1 <*> (slow 8 $ "0 0.25 0.75")) ~~~~
doc/tidal.pdf view
binary file changed (99443 → 105469 bytes)
tidal.cabal view
@@ -1,5 +1,5 @@ name: tidal-version: 0.2.11+version: 0.2.13 synopsis: Pattern language for improvised music -- description: homepage: http://yaxu.org/tidal/
tidal.el view
@@ -55,16 +55,16 @@ tidal-interpreter-arguments) (tidal-see-output)) (tidal-send-string ":set prompt \"\"")- (tidal-send-string ":load Sound.Tidal.Context")- (tidal-send-string "d1 <- dirtstream \"d1\"")- (tidal-send-string "d2 <- dirtstream \"d2\"")- (tidal-send-string "d3 <- dirtstream \"d3\"")- (tidal-send-string "d4 <- dirtstream \"d4\"")- (tidal-send-string "d5 <- dirtstream \"d5\"")- (tidal-send-string "d6 <- dirtstream \"d6\"")- (tidal-send-string "d7 <- dirtstream \"d7\"")- (tidal-send-string "d8 <- dirtstream \"d8\"")- (tidal-send-string "d9 <- dirtstream \"d9\"")+ (tidal-send-string ":module Sound.Tidal.Context")+ (tidal-send-string "d1 <- dirtStream")+ (tidal-send-string "d2 <- dirtStream")+ (tidal-send-string "d3 <- dirtStream")+ (tidal-send-string "d4 <- dirtStream")+ (tidal-send-string "d5 <- dirtStream")+ (tidal-send-string "d6 <- dirtStream")+ (tidal-send-string "d7 <- dirtStream")+ (tidal-send-string "d8 <- dirtStream")+ (tidal-send-string "d9 <- dirtStream") (tidal-send-string "bps <- bpsSetter") (tidal-send-string "let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9]") (tidal-send-string ":set prompt \"tidal> \"")