Permalink
Browse files

twiddles

  • Loading branch information...
1 parent 6ab3f7c commit 25216f3942db43f6dfece6bb2b0b15322520897e alex committed Feb 26, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 Dirt.hs
View
@@ -90,6 +90,12 @@ striate :: Int -> OscSequence -> OscSequence
striate n p = cat $ map (\x -> off (fromIntegral x) p) [0 .. n-1]
where off i p = p ~~ begin (atom (fromIntegral i / fromIntegral n) :: Sequence Double) ~~ end (atom (fromIntegral (i+1) / fromIntegral n) :: Sequence Double)
+striate' :: Int -> Double -> OscSequence -> OscSequence
+striate' n f p = slowcat $ map (\x -> off (fromIntegral x) p) [0 .. n-1]
+ where off i p = p ~~ begin (atom (slot * i) :: Sequence Double) ~~ end (atom ((slot * i) + f) :: Sequence Double)
+ slot = (1 - f) / (fromIntegral n)
+
+
striateO :: OscSequence -> Int -> Double -> OscSequence
striateO p n o = cat $ map (\x -> off (fromIntegral x) p) [0 .. n-1]
where off i p = p ~~ begin ((atom $ (fromIntegral i / fromIntegral n) + o) :: Sequence Double) ~~ end ((atom $ (fromIntegral (i+1) / fromIntegral n) + o) :: Sequence Double)

0 comments on commit 25216f3

Please sign in to comment.