@@ -20,7 +20,7 @@ module Sound.Tidal.Scales (scale, scaleList, scaleTable, getScale, scaleWith, sc
2020
2121import Data.Maybe (fromMaybe )
2222import Sound.Tidal.Core (slowcat )
23- import Sound.Tidal.Pattern (Pattern , arc , (<*) )
23+ import Sound.Tidal.Pattern (Pattern , (<*) )
2424import Sound.Tidal.Utils ((!!!) )
2525import Prelude hiding ((*>) , (<*) )
2626
@@ -322,30 +322,17 @@ These are equivalent:
322322
323323-}
324324scaleWith :: (Eq a , Fractional a ) => Pattern String -> ([a ] -> [a ]) -> Pattern Int -> Pattern a
325- scaleWith = getScaleWith scaleTable
325+ scaleWith = getScaleMod scaleTable
326326
327327{- Variant of @scaleWith@ providing a list of modifier functions instead of a single function
328328-}
329329scaleWithList :: (Eq a , Fractional a ) => Pattern String -> ([[a ] -> [a ]]) -> Pattern Int -> Pattern a
330- scaleWithList _ [] _ = silence
331- scaleWithList sp (f : [] ) p = scaleWith sp f p
332- scaleWithList sp fs p = Pattern q
333- where
334- n = length fs
335- q st =
336- concatMap (ff st) $
337- arcCyclesZW (arc st)
338- ff st a = query pp $ st {arc = a}
339- where
340- f = fs !! i
341- cyc = (floor $ start a) :: Int
342- i = cyc `mod` n
343- pp = (scaleWith sp f p)
330+ scaleWithList sp fs p = slowcat $ map (\ f -> scaleWith sp f p) fs
344331
345332{- Variant of @getScale@ used to build the @scaleWith@ function
346333-}
347- getScaleWith :: (Eq a , Fractional a ) => [(String , [a ])] -> Pattern String -> ([a ] -> [a ]) -> Pattern Int -> Pattern a
348- getScaleWith table sp f p =
334+ getScaleMod :: (Eq a , Fractional a ) => [(String , [a ])] -> Pattern String -> ([a ] -> [a ]) -> Pattern Int -> Pattern a
335+ getScaleMod table sp f p =
349336 ( \ n scaleName ->
350337 noteInScale (uniq $ f $ fromMaybe [0 ] $ lookup scaleName table) n
351338 )
0 commit comments