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

Revert "Corrects the scaleWithList function "#1206

Merged
yaxu merged 1 commit into
mainfrom
revert-1193-chromatic
Jun 7, 2025
Merged

Revert "Corrects the scaleWithList function "#1206
yaxu merged 1 commit into
mainfrom
revert-1193-chromatic

Conversation

@yaxu

@yaxu yaxu commented Jun 7, 2025

Copy link
Copy Markdown
Member

Reverts #1193

There's something funny going on here.. More things missing from Sound.Tidal.Pattern, but when I import everything with import Sound.Tidal.Pattern, scaleWithList doesn't typecheck. Could you take a look please @aherrou ?

@yaxu

yaxu commented Jun 7, 2025

Copy link
Copy Markdown
Member Author

Looking at the underlying issue with the original version of it:

scaleWithList sp fs p = slowcat $ map (\f -> scaleWith sp f p) fs

chunk works in a same way, repeating the source pattern for each variant, and it can be quite nice. In strudel we made fastchunk which doesn't repeat cycles from the source pattern (note to self - backport that to tidal). I haven't used it myself, but are there cases when someone might want the previous, 'slow' behaviour of scaleWithList?

In any case I feel there should be a shorter way of expressing the desired behaviour without getting into the weeds of manipulating events directly, will have a think..

@yaxu
yaxu merged commit 433ed7f into main Jun 7, 2025
36 checks passed
@yaxu

yaxu commented Jun 7, 2025

Copy link
Copy Markdown
Member Author

I haven't tested it (not sure how it's actually used!) but how about this:

scaleWithList :: (Eq a, Fractional a) => Pattern String -> ([[a] -> [a]]) -> Pattern Int -> Pattern a
scaleWithList sp fs p = innerJoin $ (\f -> scaleWith sp f p) <$> slowcat fs

I think that will have the source pattern not repeat cycles.

Then if the old behaviour is potentially useful to someone we could preserve it as scaleWithListSlow:

scaleWithListSlow :: (Eq a, Fractional a) => Pattern String -> ([[a] -> [a]]) -> Pattern Int -> Pattern a
scaleWithListSlow sp fs p = slowcat $ map (\f -> scaleWith sp f p) fs

Does that make sense @aherrou ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant