Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 433ed7f

Browse files
authored
Merge pull request #1206 from tidalcycles/revert-1193-chromatic
Revert "Corrects the scaleWithList function "
2 parents 1b7ec66 + 3d5d3c6 commit 433ed7f

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

tidal-core/src/Sound/Tidal/Scales.hs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Sound.Tidal.Scales (scale, scaleList, scaleTable, getScale, scaleWith, sc
2020

2121
import Data.Maybe (fromMaybe)
2222
import Sound.Tidal.Core (slowcat)
23-
import Sound.Tidal.Pattern (Pattern, arc, (<*))
23+
import Sound.Tidal.Pattern (Pattern, (<*))
2424
import Sound.Tidal.Utils ((!!!))
2525
import Prelude hiding ((*>), (<*))
2626

@@ -322,30 +322,17 @@ These are equivalent:
322322
323323
-}
324324
scaleWith :: (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
-}
329329
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
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

Comments
 (0)