Skip to content

Commit

Permalink
Merge pull request #1083 from mindofmatthew/set-bpm
Browse files Browse the repository at this point in the history
Add `getbpm` and `setbpm` to boot functions
  • Loading branch information
yaxu authored Jul 30, 2024
2 parents c69162e + d83c2cc commit dc74821
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/Sound/Tidal/Boot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ module Sound.Tidal.Boot
, setCycle
, setcps
, getcps
, setbpm
, getbpm
, getnow
, d1
, d2
Expand Down Expand Up @@ -216,10 +218,18 @@ setCycle = streamSetCycle tidal
setcps :: Tidally => Pattern Double -> IO ()
setcps = once . cps

-- | See 'Sound.Tidal.Stream.streamGetcps'.
-- | See 'Sound.Tidal.Stream.streamGetCPS'.
getcps :: Tidally => IO Time
getcps = streamGetCPS tidal

-- | See 'Sound.Tidal.Stream.streamGetBPM'.
setbpm :: Tidally => Time -> IO ()
setbpm = streamSetBPM tidal

-- | See 'Sound.Tidal.Stream.streamGetBPM'.
getbpm :: Tidally => IO Time
getbpm = streamGetBPM tidal

-- | See 'Sound.Tidal.Stream.streamGetnow'.
getnow :: Tidally => IO Time
getnow = streamGetNow tidal
Expand Down
6 changes: 3 additions & 3 deletions src/Sound/Tidal/Stream/UI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ streamResetCycles s = streamSetCycle s 0
streamSetCycle :: Stream -> Time -> IO ()
streamSetCycle s = Clock.setClock (sClockRef s)

streamSetBPM :: Stream -> Time -> IO ()
streamSetBPM s = Clock.setBPM (sClockRef s)

streamSetCPS :: Stream -> Time -> IO ()
streamSetCPS s = Clock.setCPS (cClockConfig $ sConfig s) (sClockRef s)

streamSetBPM :: Stream -> Time -> IO ()
streamSetBPM s = Clock.setBPM (sClockRef s)

streamGetCPS :: Stream -> IO Time
streamGetCPS s = Clock.getCPS (cClockConfig $ sConfig s)(sClockRef s)

Expand Down

0 comments on commit dc74821

Please sign in to comment.