Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add metatune param, now against 1.9-dev #1046

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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