Skip to content

Commit

Permalink
fix warns
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu committed Apr 11, 2024
1 parent b0ed36f commit 323dfb7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Sound/Tidal/Stream/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ toOSC busses pe osc@(OSC _ _)
-- (but perhaps we should explicitly crash with an error message if it contains something else?).
-- Map.mapKeys tail is used to remove ^ from the keys.
-- In case (value e) has the key "", we will get a crash here.
playmap' = Map.union (Map.mapKeys tail $ Map.map (\(VI i) -> VS ('c':(show $ toBus i))) busmap) playmap
playmap' = Map.union (Map.mapKeys tail $ Map.map (\v -> VS ('c':(show $ toBus $ fromMaybe 0 $ getI v))) busmap) playmap
val = value . peEvent
-- Only events that start within the current nowArc are included
playmsg | peHasOnset pe = do
Expand All @@ -198,11 +198,13 @@ toOSC busses pe osc@(OSC _ _)
toBus n | null busses = n
| otherwise = busses !!! n
busmsgs = map
(\(('^':k), (VI b)) -> do v <- Map.lookup k playmap
return $ (tsPart,
True, -- bus message ?
O.Message "/c_set" [O.int32 b, toDatum v]
)
(\(k, b) -> do k' <- if (not $ null k) && head k == '^' then Just (tail k) else Nothing
v <- Map.lookup k' playmap
bi <- getI b
return $ (tsPart,
True, -- bus message ?
O.Message "/c_set" [O.int32 bi, toDatum v]
)
)
(Map.toList busmap)
where
Expand Down

0 comments on commit 323dfb7

Please sign in to comment.