Skip to content

Commit

Permalink
add ability to enable/disable link clock and make default link False,…
Browse files Browse the repository at this point in the history
… see #1060
  • Loading branch information
polymorphicengine committed Dec 30, 2023
1 parent cf95e13 commit 3fedf10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Sound/Tidal/Stream.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion tidal-link/src/hs/Sound/Tidal/Clock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 3fedf10

Please sign in to comment.