From b2161fb319a8b2721fff5e7dbe6cae9bcbb6e74f Mon Sep 17 00:00:00 2001 From: miranda Date: Thu, 26 Oct 2023 09:00:43 +0300 Subject: [PATCH] add metatune param --- bin/generate-params.hs | 1 + src/Sound/Tidal/Params.hs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/bin/generate-params.hs b/bin/generate-params.hs index 95c43c461..587459960 100755 --- a/bin/generate-params.hs +++ b/bin/generate-params.hs @@ -178,6 +178,7 @@ genericParams = [ ("f", "loop", "loops the sample (from `begin` to `end`) the specified number of times."), ("f", "lophat", ""), ("f", "lsnare", ""), + ("f", "metatune", "A pattern of numbers. Specifies whether the pitch of played samples should be tuned relative to their pitch metadata, if it exists. When set to 1, pitch metadata is applied. When set to 0, pitch metadata is ignored."), ("note", "n", "The note or sample number to choose for a synth or sampleset"), ("note", "note", "The note or pitch to play a sound or synth with"), ("f", "degree", ""), diff --git a/src/Sound/Tidal/Params.hs b/src/Sound/Tidal/Params.hs index ea6999e77..cd229dbfd 100644 --- a/src/Sound/Tidal/Params.hs +++ b/src/Sound/Tidal/Params.hs @@ -1630,6 +1630,21 @@ lsnarebus busid pat = (pF "lsnare" pat) # (pI "^lsnare" busid) lsnarerecv :: Pattern Int -> ControlPattern lsnarerecv busid = pI "^lsnare" busid +-- | A pattern of numbers. Specifies whether the pitch of played samples should be tuned relative to their pitch metadata, if it exists. When set to 1, pitch metadata is applied. When set to 0, pitch metadata is ignored. +metatune :: Pattern Double -> ControlPattern +metatune = pF "metatune" +metatuneTake :: String -> [Double] -> ControlPattern +metatuneTake name xs = pStateListF "metatune" name xs +metatuneCount :: String -> ControlPattern +metatuneCount name = pStateF "metatune" name (maybe 0 (+1)) +metatuneCountTo :: String -> Pattern Double -> Pattern ValueMap +metatuneCountTo name ipat = innerJoin $ (\i -> pStateF "metatune" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat + +metatunebus :: Pattern Int -> Pattern Double -> ControlPattern +metatunebus busid pat = (pF "metatune" pat) # (pI "^metatune" busid) +metatunerecv :: Pattern Int -> ControlPattern +metatunerecv busid = pI "^metatune" busid + -- | midibend :: Pattern Double -> ControlPattern midibend = pF "midibend"