@@ -20,7 +20,7 @@ module Sound.Tidal.Scales (scale, scaleList, scaleTable, getScale, scaleWith, sc
20
20
21
21
import Data.Maybe (fromMaybe )
22
22
import Sound.Tidal.Core (slowcat )
23
- import Sound.Tidal.Pattern (Pattern , arc , (<*) )
23
+ import Sound.Tidal.Pattern (Pattern , (<*) )
24
24
import Sound.Tidal.Utils ((!!!) )
25
25
import Prelude hiding ((*>) , (<*) )
26
26
@@ -322,30 +322,17 @@ These are equivalent:
322
322
323
323
-}
324
324
scaleWith :: (Eq a , Fractional a ) => Pattern String -> ([a ] -> [a ]) -> Pattern Int -> Pattern a
325
- scaleWith = getScaleWith scaleTable
325
+ scaleWith = getScaleMod scaleTable
326
326
327
327
{- Variant of @scaleWith@ providing a list of modifier functions instead of a single function
328
328
-}
329
329
scaleWithList :: (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
344
331
345
332
{- Variant of @getScale@ used to build the @scaleWith@ function
346
333
-}
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 =
349
336
( \ n scaleName ->
350
337
noteInScale (uniq $ f $ fromMaybe [0 ] $ lookup scaleName table) n
351
338
)
0 commit comments