Browse files

spread and spread'

  • Loading branch information...
1 parent a5aca3c commit 0204b8b968054bcf712ea1d94c4aa043793f40cd @yaxu committed Feb 26, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 Strategies.hs
View
8 Strategies.hs
@@ -20,7 +20,9 @@ brak = every 2 (((1%4) <~) . (\x -> cat [x, silence]))
-- samples "jvbass [~ latibro] [jvbass [latibro jvbass]]" ((1%2) <~ slow 6 "[1 6 8 7 3]")
samples p p' = sample <$> p <*> p'
+spread f xs p = cat $ map (\x -> f x p) xs
-
-
-
+spread' :: (a -> Sequence b -> Sequence c) -> Sequence a -> Sequence b -> Sequence c
+spread' f timepat pat =
+ Sequence $ \r -> concatMap (\(r', x) -> (range (f x pat) r')) (rs r)
+ where rs r = mapFsts (mapSnd Just) $ range (filterOffsets timepat) r

0 comments on commit 0204b8b

Please sign in to comment.