Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit ba67b1d

Browse files
committed
recombine config
1 parent e47edd0 commit ba67b1d

File tree

10 files changed

+20
-82
lines changed

10 files changed

+20
-82
lines changed

src/Sound/Tidal/Safe/Context.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import Sound.Tidal.ParseBP as C
6565
import Sound.Tidal.Pattern as C
6666
import Sound.Tidal.Scales as C
6767
import Sound.Tidal.Simple as C
68-
import Sound.Tidal.Stream.Config as C
68+
import Sound.Tidal.Config as C
6969
import Sound.Tidal.Stream.Main (startTidal)
7070
import Sound.Tidal.Stream.Target (superdirtTarget)
7171
import Sound.Tidal.Stream.Types (Target (..))

src/Sound/Tidal/Stream.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Sound.Tidal.Stream
2-
( module Sound.Tidal.Stream.Config,
2+
( module Sound.Tidal.Config,
33
module Sound.Tidal.Stream.Types,
44
module Sound.Tidal.Stream.Process,
55
module Sound.Tidal.Stream.Target,
@@ -9,7 +9,7 @@ module Sound.Tidal.Stream
99
)
1010
where
1111

12-
import Sound.Tidal.Stream.Config
12+
import Sound.Tidal.Config
1313
import Sound.Tidal.Stream.Listen
1414
import Sound.Tidal.Stream.Main
1515
import Sound.Tidal.Stream.Process

src/Sound/Tidal/Stream/Config.hs

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/Sound/Tidal/Stream/Listen.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import qualified Sound.Osc.Fd as O
1010
import qualified Sound.Osc.Transport.Fd.Udp as O
1111
import Sound.Tidal.ID
1212
import Sound.Tidal.Pattern
13-
import Sound.Tidal.Stream.Config
13+
import Sound.Tidal.Config
1414
import Sound.Tidal.Stream.Types
1515
import Sound.Tidal.Stream.UI
1616
import System.IO (hPutStrLn, stderr)
1717

1818
{-
1919
Listen.hs - logic for listening and acting on incoming OSC messages
20-
Copyright (C) 2020, Alex McLean and contributors
20+
Copyright (C) 2025, Alex McLean and contributors
2121
2222
This library is free software: you can redistribute it and/or modify
2323
it under the terms of the GNU General Public License as published by

src/Sound/Tidal/Stream/Main.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ module Sound.Tidal.Stream.Main where
33
import Control.Concurrent (forkIO, newMVar)
44
import qualified Data.Map as Map
55
import qualified Sound.Tidal.Clock as Clock
6-
import Sound.Tidal.Stream.Config
7-
( Config (cClockConfig, cCtrlAddr, cCtrlPort),
6+
import Sound.Tidal.Config
7+
( Config (cCtrlAddr, cCtrlPort),
88
verbose,
9+
toClockConfig
910
)
1011
import Sound.Tidal.Stream.Listen
1112
( ctrlResponder,
@@ -54,7 +55,7 @@ startStream config oscmap = do
5455

5556
cxs <- getCXs config oscmap
5657

57-
clockRef <- Clock.clocked (cClockConfig config) (doTick sMapMV pMapMV globalFMV cxs)
58+
clockRef <- Clock.clocked (toClockConfig config) (doTick sMapMV pMapMV globalFMV cxs)
5859

5960
let stream =
6061
Stream

src/Sound/Tidal/Stream/Target.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import qualified Sound.Osc.Fd as O
1616
import qualified Sound.Osc.Time.Timeout as O
1717
import qualified Sound.Osc.Transport.Fd.Udp as O
1818
import Sound.Tidal.Pattern
19-
import Sound.Tidal.Stream.Config
19+
import Sound.Tidal.Config
2020
import Sound.Tidal.Stream.Types
2121

2222
{-

src/Sound/Tidal/Stream/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import qualified Sound.Osc.Transport.Fd.Udp as O
77
import qualified Sound.Tidal.Clock as Clock
88
import Sound.Tidal.Pattern
99
import Sound.Tidal.Show ()
10-
import Sound.Tidal.Stream.Config
10+
import Sound.Tidal.Config
1111

1212
data Stream = Stream
1313
{ sConfig :: Config,

src/Sound/Tidal/Stream/UI.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import qualified Data.Map as Map
99
import qualified Sound.Tidal.Clock as Clock
1010
import Sound.Tidal.ID
1111
import Sound.Tidal.Pattern
12-
import Sound.Tidal.Stream.Config
12+
import Sound.Tidal.Config
1313
import Sound.Tidal.Stream.Process
1414
import Sound.Tidal.Stream.Types
1515
import System.IO (hPutStrLn, stderr)
@@ -25,19 +25,19 @@ streamSetCycle :: Stream -> Time -> IO ()
2525
streamSetCycle s = Clock.setClock (sClockRef s)
2626

2727
streamSetCPS :: Stream -> Time -> IO ()
28-
streamSetCPS s = Clock.setCPS (cClockConfig $ sConfig s) (sClockRef s)
28+
streamSetCPS s = Clock.setCPS (toClockConfig $ sConfig s) (sClockRef s)
2929

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

3333
streamGetCPS :: Stream -> IO Time
34-
streamGetCPS s = Clock.getCPS (cClockConfig $ sConfig s) (sClockRef s)
34+
streamGetCPS s = Clock.getCPS (toClockConfig $ sConfig s) (sClockRef s)
3535

3636
streamGetBPM :: Stream -> IO Time
3737
streamGetBPM s = Clock.getBPM (sClockRef s)
3838

3939
streamGetNow :: Stream -> IO Time
40-
streamGetNow s = Clock.getCycleTime (cClockConfig $ sConfig s) (sClockRef s)
40+
streamGetNow s = Clock.getCycleTime (toClockConfig $ sConfig s) (sClockRef s)
4141

4242
streamEnableLink :: Stream -> IO ()
4343
streamEnableLink s = Clock.enableLink (sClockRef s)
@@ -59,7 +59,7 @@ streamList s = do
5959

6060
streamReplace :: Stream -> ID -> ControlPattern -> IO ()
6161
streamReplace stream k !pat = do
62-
t <- Clock.getCycleTime (cClockConfig $ sConfig stream) (sClockRef stream)
62+
t <- Clock.getCycleTime (toClockConfig $ sConfig stream) (sClockRef stream)
6363
E.handle
6464
( \(e :: E.SomeException) -> do
6565
hPutStrLn stderr $ "Failed to Stream.streamReplace: " ++ show e
@@ -75,7 +75,7 @@ streamOnce st p = do
7575
streamFirst st $ rotL (toRational (i :: Int)) p
7676

7777
streamFirst :: Stream -> ControlPattern -> IO ()
78-
streamFirst stream pat = onSingleTick (cClockConfig $ sConfig stream) (sClockRef stream) (sStateMV stream) (sPMapMV stream) (sGlobalFMV stream) (sCxs stream) pat
78+
streamFirst stream pat = onSingleTick (toClockConfig $ sConfig stream) (sClockRef stream) (sStateMV stream) (sPMapMV stream) (sGlobalFMV stream) (sCxs stream) pat
7979

8080
streamMute :: Stream -> ID -> IO ()
8181
streamMute s k = withPatIds s [k] (\x -> x {psMute = True})

src/Sound/Tidal/Transition.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Sound.Tidal.Core
1212
import Sound.Tidal.ID (ID (fromID))
1313
import Sound.Tidal.Params (gain, pan)
1414
import Sound.Tidal.Pattern
15-
import Sound.Tidal.Stream.Config (Config (cClockConfig))
15+
import Sound.Tidal.Config (toClockConfig)
1616
import Sound.Tidal.Stream.Types
1717
( PlayState (PlayState, psHistory, psMute, psPattern, psSolo),
1818
Stream (sClockRef, sConfig, sPMapMV),
@@ -56,7 +56,7 @@ transition stream historyFlag mapper patId !pat = do
5656
psHistory = appendPat historyFlag [silence]
5757
}
5858
transition' pat' = do
59-
t <- Clock.getCycleTime (cClockConfig $ sConfig stream) (sClockRef stream)
59+
t <- Clock.getCycleTime (toClockConfig $ sConfig stream) (sClockRef stream)
6060
return $! mapper t pat'
6161
pMap <- readMVar (sPMapMV stream)
6262
let playState = updatePS $ Map.lookup (fromID patId) pMap

tidal.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ library
2929

3030
Exposed-modules:
3131
Sound.Tidal.Boot
32+
Sound.Tidal.Config
3233
Sound.Tidal.Context
3334
Sound.Tidal.ID
3435
Sound.Tidal.Safe.Context
3536
Sound.Tidal.Safe.Boot
3637
Sound.Tidal.Stream
37-
Sound.Tidal.Stream.Config
3838
Sound.Tidal.Stream.Listen
3939
Sound.Tidal.Stream.Main
4040
Sound.Tidal.Stream.Process

0 commit comments

Comments
 (0)