Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tactus tweaks, add s_taperBy #1088

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Sound/Tidal/Control.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import Prelude hiding ((*>), (<*))

import qualified Data.Map.Strict as Map
import Data.Maybe (fromJust, fromMaybe, isJust)

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

The import of ‘fromJust, isJust’

Check warning on line 30 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘fromJust, isJust’
import Data.Ratio

import Sound.Tidal.Core
Expand All @@ -35,7 +35,7 @@
import Sound.Tidal.Pattern
import Sound.Tidal.Stream.Types (patternTimeID)
import Sound.Tidal.UI
import Sound.Tidal.Utils

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

The import of ‘Sound.Tidal.Utils’ is redundant

Check warning on line 38 in src/Sound/Tidal/Control.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

The import of ‘Sound.Tidal.Utils’ is redundant

{- | `spin` will "spin" and layer up a pattern the given number of times,
with each successive layer offset in time by an additional @1/n@ of a cycle,
Expand Down Expand Up @@ -331,7 +331,7 @@
> d1 $ splice 8 "[<0*8 0*2> 3*4 2 4] [4 .. 7]" $ sound "breaks165"
-}
splice :: Pattern Int -> Pattern Int -> ControlPattern -> Pattern (Map.Map String Value)
splice bitpat ipat pat = innerJoin $ (\bits -> _splice bits ipat pat) <$> bitpat
splice bitpat ipat pat = setTactusFrom bitpat $ innerJoin $ (\bits -> _splice bits ipat pat) <$> bitpat

{-|
@loopAt@ makes a sample fit the given number of cycles. Internally, it
Expand Down
3 changes: 2 additions & 1 deletion src/Sound/Tidal/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ zoom :: (Time, Time) -> Pattern a -> Pattern a
zoom (s,e) = zoomArc (Arc s e)

zoomArc :: Arc -> Pattern a -> Pattern a
zoomArc (Arc s e) p = withTactus (*d) $ splitQueries $
zoomArc (Arc s e) p | s >= e = nothing
| otherwise = withTactus (*d) $ splitQueries $
withResultArc (mapCycle ((/d) . subtract s)) $ withQueryArc (mapCycle ((+s) . (*d))) p
where d = e-s

Expand Down
3 changes: 3 additions & 0 deletions src/Sound/Tidal/Pattern.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ pattern f = Pattern f Nothing Nothing
setTactus :: Rational -> Pattern a -> Pattern a
setTactus r p = p {tactus = Just r}

setTactusFrom :: Pattern b -> Pattern a -> Pattern a
setTactusFrom a b = b {tactus = tactus a}

withTactus :: (Rational -> Rational) -> Pattern a -> Pattern a
withTactus f p = p {tactus = f <$> tactus p}

Expand Down
26 changes: 25 additions & 1 deletion src/Sound/Tidal/Stepwise.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,31 @@
-- TODO exception?
s_taperlist pat = [pat]


s_taperlistBy :: Int -> Int -> Pattern a -> [Pattern a]
s_taperlistBy amount times pat@(Pattern _ (Just t) _)

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Pattern match(es) are non-exhaustive

Check warning on line 99 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Pattern match(es) are non-exhaustive
| times == 1 = [pat]
| times <= 0 = []
| amount == 0 = [pat]
| backwards = reverse l
| otherwise = l
where backwards = amount > 0
n = toRational $ abs amount
start = t - (toRational $ max 0 $ n * (toRational $ times - 1))

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

This binding for ‘start’ shadows the existing binding

Check warning on line 107 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

This binding for ‘start’ shadows the existing binding
l = (map (\i -> zoom (0, (start + (n * (toRational i))) / t) pat) [0 .. times-2]) ++ [pat]

-- | Plays one fewer step from the pattern each repetition, down to nothing
s_taper :: Pattern a -> Pattern a
s_taper = s_cat . s_taperlist

-- | Plays one fewer step from the pattern each repetition, down to nothing
_s_taperBy :: Int -> Int -> Pattern a -> Pattern a
_s_taperBy amount times pat = s_cat $ s_taperlistBy amount times pat

-- | Plays one fewer step from the pattern each repetition, down to nothing
s_taperBy :: Pattern Int -> Pattern Int -> Pattern a -> Pattern a
s_taperBy = s_patternify2 _s_taperBy

-- | Successively plays a pattern from each group in turn
s_alt :: [[Pattern a]] -> Pattern a
s_alt groups = s_cat $ concat $ take (c * length groups) $ transpose $ map cycle groups
Expand All @@ -119,9 +140,12 @@
s_patternify f (Pattern _ _ (Just a)) b = f a b
s_patternify f pa p = stepJoin $ (`f` p) <$> pa

s_patternify2 :: (a -> b -> c -> Pattern d) -> Pattern a -> Pattern b -> c -> Pattern d
s_patternify2 f a b p = stepJoin $ (\x y -> f x y p) <$> a <*> b

stepJoin :: Pattern (Pattern a) -> Pattern a
stepJoin pp = Pattern q first_t Nothing
where q st@(State a c) = query (timecat $ retime $ slices $ query (rotL (sam $ start a) pp) (st {arc = Arc 0 1})) st

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Defined but not used: ‘c’

Check warning on line 148 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘c’
first_t :: Maybe Rational
first_t = tactus $ timecat $ retime $ slices $ queryArc pp (Arc 0 1)
retime :: [(Time, Pattern a)] -> [(Time, Pattern a)]
Expand All @@ -129,11 +153,11 @@
where occupied_perc = sum $ map fst $ filter (isJust . tactus . snd) xs
occupied_tactus = sum $ catMaybes $ map (tactus . snd) xs
total_tactus = occupied_tactus / occupied_perc
adjust dur pat@(Pattern {tactus = Just t}) = (t, pat)

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.8.3

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.10.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 8.6.5

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal latest - ghc latest

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.4.0.0 - ghc 9.0.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / cabal 3.8.1.0 - ghc 9.4.1

Defined but not used: ‘dur’

Check warning on line 156 in src/Sound/Tidal/Stepwise.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1, 3.4.0.0)

Defined but not used: ‘dur’
adjust dur pat = (dur*total_tactus, pat)
-- break up events at all start/end points, into groups, including empty ones.
slices :: [Event (Pattern a)] -> [(Time, Pattern a)]
slices evs = map (\s -> ((snd s - fst s), stack $ map value $ fit s evs)) $ pairs $ sort $ nubOrd $ 0:1:concatMap (\ev -> start (part ev):stop (part ev):[]) evs
slices evs = map (\s -> ((snd s - fst s), stack $ map (\x -> withContext (\c -> combineContexts [c, context x]) $ value x) $ fit s evs)) $ pairs $ sort $ nubOrd $ 0:1:concatMap (\ev -> start (part ev):stop (part ev):[]) evs
-- list of slices of events within the given range
fit :: (Rational, Rational) -> [Event (Pattern a)] -> [Event (Pattern a)]
fit (b,e) evs = catMaybes $ map (match (b,e)) evs
Expand Down
Loading