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 #1042

Closed
wants to merge 1 commit into from
Closed
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 @@ -1609,6 +1609,21 @@ lsnarebus busid pat = pF "lsnare" pat # pI "^lsnare" busid
lsnarerecv :: Pattern p => p Int -> p ValueMap
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 p => p Double -> p ValueMap
metatune = pF "metatune"
metatuneTake :: Pattern p => String -> [Double] -> p ValueMap
metatuneTake name xs = pStateListF "metatune" name xs
metatuneCount :: Pattern p => String -> p ValueMap
metatuneCount name = pStateF "metatune" name (maybe 0 (+1))
metatuneCountTo :: Pattern p => String -> p Double -> p ValueMap
metatuneCountTo name ipat = innerJoin $ (\i -> pStateF "metatune" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat

metatunebus :: Pattern p => p Int -> p Double -> p ValueMap
metatunebus busid pat = pF "metatune" pat # pI "^metatune" busid
metatunerecv :: Pattern p => p Int -> p ValueMap
metatunerecv busid = pI "^metatune" busid

-- |
midibend :: Pattern p => p Double -> p ValueMap
midibend = pF "midibend"
Expand Down