From 227c051733749560ad6a18737691e954d6e03b9e Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:06:24 -0300 Subject: [PATCH 1/5] add underscore silence shorthands for p and d1-16 --- BootTidal.hs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/BootTidal.hs b/BootTidal.hs index 1157ec015..1f46ea775 100644 --- a/BootTidal.hs +++ b/BootTidal.hs @@ -65,6 +65,40 @@ let only = (hush >>) d14 = p 14 d15 = p 15 d16 = p 16 + _p n pat = streamReplace tidal n silence + p_ = _p + _d1 = _p 1 + _d2 = _p 2 + _d3 = _p 3 + _d4 = _p 4 + _d5 = _p 5 + _d6 = _p 6 + _d7 = _p 7 + _d8 = _p 8 + _d9 = _p 9 + _d10 = _p 10 + _d11 = _p 11 + _d12 = _p 12 + _d13 = _p 13 + _d14 = _p 14 + _d15 = _p 15 + _d16 = _p 16 + d1_ = _d1 + d2_ = _d2 + d3_ = _d3 + d4_ = _d4 + d5_ = _d5 + d6_ = _d6 + d7_ = _d7 + d8_ = _d8 + d9_ = _d9 + d10_ = _d10 + d11_ = _d11 + d12_ = _d12 + d13_ = _d13 + d14_ = _d14 + d15_ = _d15 + d16_ = _d16 :} :{ From a964bacb0d74a28338251f688fa0ec89a32ff146 Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:12:03 -0300 Subject: [PATCH 2/5] minor style difference --- BootTidal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BootTidal.hs b/BootTidal.hs index 1f46ea775..80093234b 100644 --- a/BootTidal.hs +++ b/BootTidal.hs @@ -65,7 +65,7 @@ let only = (hush >>) d14 = p 14 d15 = p 15 d16 = p 16 - _p n pat = streamReplace tidal n silence + _p n _ = streamReplace tidal n silence p_ = _p _d1 = _p 1 _d2 = _p 2 From ef6beb1e9e4052fb5738d639dc467d2d7604adfc Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:01:17 -0300 Subject: [PATCH 3/5] add `_` muting to Sound.Tidal.Boot --- src/Sound/Tidal/Boot.hs | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/Sound/Tidal/Boot.hs b/src/Sound/Tidal/Boot.hs index edae71f52..7dc234a9e 100644 --- a/src/Sound/Tidal/Boot.hs +++ b/src/Sound/Tidal/Boot.hs @@ -107,6 +107,14 @@ only = (hush >>) p :: Tidally => ID -> ControlPattern -> IO () p = streamReplace tidal +-- | Silences a specific stream, regardless of ControlPattern input. Useful for rapid muting of streams +_p :: Tidally => ID -> ControlPattern -> IO () +_p n _ = streamReplace tidal n silence + +-- | Silences a specific stream, regardless of ControlPattern input. Useful for rapid muting of streams +p_ :: Tidally => ID -> ControlPattern -> IO () +p_ = _p + -- | See 'Sound.Tidal.Stream.streamHush'. hush :: Tidally => IO () hush = streamHush tidal @@ -201,6 +209,44 @@ d14 = p 14 d15 = p 15 d16 = p 16 +-- | Rapidly silence what's playing on the given orbit +_d1, _d2, _d3, _d4, _d5, _d6, _d7, _d8, _d9, _d10, _d11, _d12, _d13, _d14, _d15, _d16 :: Tidally => ControlPattern -> IO () +_d1 = _p 1 +_d2 = _p 2 +_d3 = _p 3 +_d4 = _p 4 +_d5 = _p 5 +_d6 = _p 6 +_d7 = _p 7 +_d8 = _p 8 +_d9 = _p 9 +_d10 = _p 10 +_d11 = _p 11 +_d12 = _p 12 +_d13 = _p 13 +_d14 = _p 14 +_d15 = _p 15 +_d16 = _p 16 + +-- | Rapidly silence what's playing on the given orbit +d1_, d2_, d3_, d4_, d5_, d6_, d7_, d8_, d9_, d10_, d11_, d12_, d13_, d14_, d15_, d16_ :: Tidally => ControlPattern -> IO () +d1_ = _d1 +d2_ = _d2 +d3_ = _d3 +d4_ = _d4 +d5_ = _d5 +d6_ = _d6 +d7_ = _d7 +d8_ = _d8 +d9_ = _d9 +d10_ = _d10 +d11_ = _d11 +d12_ = _d12 +d13_ = _d13 +d14_ = _d14 +d15_ = _d15 +d16_ = _d16 + -- | See 'Sound.Tidal.Stream.streamGet'. getState :: Tidally => String -> IO (Maybe Value) getState = streamGet tidal From 8e7ee3964dc3ef76ad0ff54ef39728b3d78e9b81 Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:45:33 -0300 Subject: [PATCH 4/5] export muting funcs --- src/Sound/Tidal/Boot.hs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Sound/Tidal/Boot.hs b/src/Sound/Tidal/Boot.hs index 7dc234a9e..9ccdc0fa7 100644 --- a/src/Sound/Tidal/Boot.hs +++ b/src/Sound/Tidal/Boot.hs @@ -9,6 +9,8 @@ module Sound.Tidal.Boot , mkTidalWith , only , p + , _p + , p_ , hush , panic , list @@ -44,6 +46,38 @@ module Sound.Tidal.Boot , d14 , d15 , d16 + , _d1 + , _d2 + , _d3 + , _d4 + , _d5 + , _d6 + , _d7 + , _d8 + , _d9 + , _d10 + , _d11 + , _d12 + , _d13 + , _d14 + , _d15 + , _d16 + , d1_ + , d2_ + , d3_ + , d4_ + , d5_ + , d6_ + , d7_ + , d8_ + , d9_ + , d10_ + , d11_ + , d12_ + , d13_ + , d14_ + , d15_ + , d16_ , getState , setI , setF From 1b550bd662aed23da484c0f5a06461a859a7a0b1 Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:10:49 -0300 Subject: [PATCH 5/5] solve `n` warning by renaming to `k` --- src/Sound/Tidal/Boot.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sound/Tidal/Boot.hs b/src/Sound/Tidal/Boot.hs index 9ccdc0fa7..2e6d2d17a 100644 --- a/src/Sound/Tidal/Boot.hs +++ b/src/Sound/Tidal/Boot.hs @@ -143,7 +143,7 @@ p = streamReplace tidal -- | Silences a specific stream, regardless of ControlPattern input. Useful for rapid muting of streams _p :: Tidally => ID -> ControlPattern -> IO () -_p n _ = streamReplace tidal n silence +_p k _ = streamReplace tidal k silence -- | Silences a specific stream, regardless of ControlPattern input. Useful for rapid muting of streams p_ :: Tidally => ID -> ControlPattern -> IO ()