Skip to content

Commit

Permalink
Merge pull request #1046 from ahihi/metatune-1.9
Browse files Browse the repository at this point in the history
add metatune param, now against 1.9-dev
  • Loading branch information
yaxu authored Oct 27, 2023
2 parents da4cc48 + b2161fb commit 6ffb9c4
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 6ffb9c4

Please sign in to comment.