Skip to content

Backport fastgap fix #1189

Open
Open
@yaxu

Description

@yaxu

fastgap got bugfixed in 2.0

_fastGap :: Time -> Signal a -> Signal a
_fastGap factor pat = splitQueries $ withEvent ef $ withQueryArcMaybe qf pat
-- A bit fiddly, to drop zero-width queries at the start of the next cycle
where qf (Arc b e) | bpos < 1 = Just $ Arc (cyc + bpos) (cyc + epos)
| otherwise = Nothing
where cyc = sam b
bpos = min 1 $ (b - cyc) * factor
epos = min 1 $ (e - cyc) * factor
-- Also fiddly, to maintain the right 'whole' relative to the part
ef ev = ev {whole = w', active = a'}
where a = active ev
b = aBegin a
e = aEnd a
a' = Arc (cyc + bpos) (cyc + epos)
where cyc = sam b
bpos = min 1 $ (b - cyc) / factor
epos = min 1 $ (e - cyc) / factor
w' = do w <- whole ev
let b' = aBegin a' - ((b - (aBegin w)) / factor)
e' = aEnd a' + (((aEnd w) - e) / factor)
return $ Arc b' e'

Originally posted by @yaxu in #1076

As noticed by Claude: https://discord.com/channels/779427371270275082/779743442288377876/1347507824145731616

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions