packages feed

tidal 0.2.3 → 0.2.4

raw patch · 4 files changed

+41/−23 lines, 4 filesdep ~hoscdep ~websockets

Dependency ranges changed: hosc, websockets

Files

Stream.hs view
@@ -4,7 +4,7 @@  import Data.Maybe import Sound.OSC.FD-import Sound.OpenSoundControl+import Sound.OSC.Datum import Control.Applicative import Tempo (Tempo, logicalTime, clocked,clockedTick) import Control.Concurrent@@ -12,7 +12,7 @@ import Pattern import Data.Ratio import Control.Exception as E-import Parse+import qualified Parse as P  import qualified Data.Map as Map @@ -37,9 +37,9 @@ type OscPattern = Pattern OscMap  defaultDatum :: Param -> Maybe Datum-defaultDatum (S _ (Just x)) = Just $ String x-defaultDatum (I _ (Just x)) = Just $ Int x-defaultDatum (F _ (Just x)) = Just $ Float x+defaultDatum (S _ (Just x)) = Just $ string x+defaultDatum (I _ (Just x)) = Just $ int32 x+defaultDatum (F _ (Just x)) = Just $ float x defaultDatum _ = Nothing  hasDefault :: Param -> Bool@@ -80,7 +80,7 @@          sec = floor logicalOnset          usec = floor $ 1000000 * (logicalOnset - (fromIntegral sec))          oscdata = catMaybes $ mapMaybe (\x -> Map.lookup x m') (params s)-         oscdata' = ((Int sec):(Int usec):oscdata)+         oscdata' = ((int32 sec):(int32 usec):oscdata)          osc | timestamp s = Message (path s) oscdata'              | otherwise = Message (path s) oscdata      return osc@@ -146,10 +146,10 @@         defaultV a = Just $ toOsc a         --defaultV Nothing = defaultDatum nParam -makeS = make String-makeF = make Float+makeS = make string+makeF = make float -makeI = make Int+makeI = make int32  param :: OscShape -> String -> Param param shape n = head $ filter (\x -> name x == n) (params shape)
doc/tidal.pandoc view
@@ -170,10 +170,24 @@ second one has four. Because tidal ensures both loops fit inside same duration, you end up with a polyrhythm. +You can make parts of patterns repeat by using `*`, for example the+following example produces the same pattern as the previous one:++~~~~ {#mycode .haskell}+d1 $ sound "[bd*3, [sn cp]*2]"+~~~~++Conversely, you can slow down patterns by using `/`, the following+pattern plays part of each subpattern each cycle:++~~~~ {#mycode .haskell}+d1 $ sound "[bd sn sn*3]/2 [bd sn*3 bd*4]/3"+~~~~+ ## Samples -All the samples can be found in `Dropbox/bcn/dirt/samples/`.  Here's-some samples I've collected that you could try:+All the samples can be found in the `samples` subfolder of the Dirt+distribution.  Here's some you could try:      flick sid can metal future gabba sn mouth co gretsch mt arp h cp     cr newnotes bass crow hc tabla bass0 hh bass1 bass2 oc bass3 ho@@ -186,6 +200,9 @@ 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. +If you want to add your own samples, just create a new folder in the+samples director, and put `wav` files in it.+ ## Continuous patterns  As well as making patterns as sequences, we can also use continuous@@ -224,20 +241,20 @@ repetition:  ~~~~ {#mycode .haskell}-d1 $ every 4 (rev) (sound "[bd bd] [bd [sn [sn sn] sn] sn]")+d1 $ every 4 (rev) (sound "bd*2 [bd [sn sn*2 sn] sn]") ~~~~  You can also slow down or speed up the playback of a pattern, this makes it a quarter of the speed:  ~~~~ {#mycode .haskell}-d1 $ slow 4 $ sound "[bd bd] [bd [sn [sn sn] sn] sn]"+d1 $ slow 4 $ sound "bd*2 [bd [sn sn*2 sn] sn]" ~~~~  And this four times the speed:  ~~~~ {#mycode .haskell}-d1 $ density 4 $ sound "[bd bd] [bd [sn [sn sn] sn] sn]"+d1 $ density 4 $ sound "bd*2 [bd [sn sn*2 sn] sn]" ~~~~  Note that `slow 0.25` would do exactly the same as `density 4`.@@ -245,7 +262,7 @@ Again, this can be applied selectively:  ~~~~ {#mycode .haskell}-d1 $ every 4 (density 4) $ sound "[bd bd] [bd [sn [sn sn] sn] sn]"+d1 $ every 4 (density 4) $ sound "bd*2 [bd [sn sn*2 sn] sn]" ~~~~  Note the use of parenthesis around `(density 4)`, this is needed, to@@ -256,7 +273,7 @@ by the `$` symbol, you can put them inside the pattern, for example:  ~~~~ {#mycode .haskell}-d1 $ sound (every 4 (density 4) "[bd bd] [bd [sn [sn sn] sn] sn]")+d1 $ sound (every 4 (density 4) "bd*2 [bd [sn sn*2 sn] sn]")    |+| pan sinewave1 ~~~~ @@ -268,7 +285,7 @@ `sound`.  ~~~~ {#mycode .haskell}-d1 $ sound (every 4 (density 4) "[bd bd] [bd [sn [sn sn] sn] sn]")+d1 $ sound (every 4 (density 4) "bd*2 [bd [sn sn*2 sn] sn]")    |+| pan (slow 16 sinewave1) ~~~~ @@ -283,7 +300,7 @@ from `0` to `0.5` rather than from `0` to `1`, you could do this:  ~~~~ {#mycode .haskell}-d1 $ sound "[bd bd] [bd [sn [sn sn] sn] sn]")+d1 $ sound "bd*2 [bd [sn sn*2 sn] sn]"))    |+| shape ((/ 2) <$> sinewave1) ~~~~ @@ -366,6 +383,10 @@ ~~~~  Plus more to be discovered!++You can find a stream of minimal cycles written in Tidal in the+following twitter feed:+  http://twitter.com/tidalcycles/  # Acknowledgments 
doc/tidal.pdf view

binary file changed (44740 → 158788 bytes)

tidal.cabal view
@@ -1,8 +1,5 @@--- Initial tidal.cabal generated by cabal init.  For further documentation,---  see http://haskell.org/cabal/users-guide/- name:                tidal-version:             0.2.3+version:             0.2.4 synopsis:            Pattern language for improvised music -- description:          homepage:            http://yaxu.org/tidal/@@ -23,4 +20,4 @@   Exposed-modules:     Strategies, Dirt, Pattern, Stream, Parse, Tempo, Time   Other-modules: Utils -  Build-depends: base < 5, process, parsec, hosc == 0.13, hashable, colour, containers, time, websockets, text, mtl, transformers, mersenne-random-pure64,binary +  Build-depends: base < 5, process, parsec, hosc > 0.13, hashable, colour, containers, time, websockets, text, mtl, transformers, mersenne-random-pure64,binary