Skip to content

Commit

Permalink
add metatune param
Browse files Browse the repository at this point in the history
  • Loading branch information
ahihi committed Oct 26, 2023
1 parent da4cc48 commit b2161fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/generate-params.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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", ""),
Expand Down
15 changes: 15 additions & 0 deletions src/Sound/Tidal/Params.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b2161fb

Please sign in to comment.