Heh I love questions in the 'how to do this obvious thing which tidal can't do' category.
I can see why the
repeatCycles isn't doing what you want. The way
outside works means manipulates time, so you end up in a different part of the timeline, so the same bit doesn't loop.
import qualified Data.Map.Strict as Map
freezeloop :: Show a => a -> Pattern Time -> IO ()
freezeloop ident loops = do now <- (toRational . floor) <$> getnow
pats <- MV.readMVar $ sPMapMV tidal
let pat = Map.lookup (show ident) pats
maybe (putStrLn $ "No pattern with ident " ++ show ident)
(p ident . timeLoop loops . rotL now . pattern)
Then this works:
d1 $ stack [sound "newnotes*8" # speed (rand + 1),
-- freeze pattern with ident 1, loop two cycles starting from the current one:
freezeloop 1 2
Have a play to see how that feels but I have a feeling we'll need some modulo to really get the cycles you want looping