diff --git a/src/Sound/Tidal/Stream.hs b/src/Sound/Tidal/Stream.hs index 8ea81ff84..918c2b1f7 100644 --- a/src/Sound/Tidal/Stream.hs +++ b/src/Sound/Tidal/Stream.hs @@ -561,6 +561,12 @@ streamGetBPM s = Clock.getBPM (sClockRef s) streamGetNow :: Stream -> IO Time streamGetNow s = Clock.getCycleTime (cClockConfig $ sConfig s)(sClockRef s) +streamEnableLink :: Stream -> IO () +streamEnableLink s = Clock.enableLink (sClockRef s) + +streamDisableLink :: Stream -> IO () +streamDisableLink s = Clock.disableLink (sClockRef s) + hasSolo :: Map.Map k PlayState -> Bool hasSolo = (>= 1) . length . filter solo . Map.elems diff --git a/tidal-link/src/hs/Sound/Tidal/Clock.hs b/tidal-link/src/hs/Sound/Tidal/Clock.hs index e610c8016..da7726c35 100644 --- a/tidal-link/src/hs/Sound/Tidal/Clock.hs +++ b/tidal-link/src/hs/Sound/Tidal/Clock.hs @@ -85,7 +85,7 @@ defaultCps = 0.575 defaultConfig :: ClockConfig defaultConfig = ClockConfig {cFrameTimespan = 1/20 - ,cEnableLink = True + ,cEnableLink = False ,cProcessAhead = 3/10 ,cSkipTicks = 10 ,cQuantum = 4 @@ -338,3 +338,9 @@ setCPS config ref cps = setBPM ref bpm setNudge :: ClockRef -> Double -> IO () setNudge (ClockRef clock _) n = modifyMVar_ clock (const $ return $ SetNudge n) + +disableLink :: ClockRef -> IO () +disableLink (ClockRef _ abletonLink) = Link.disable abletonLink + +enableLink :: ClockRef -> IO () +enableLink (ClockRef _ abletonLink) = Link.enable abletonLink