From afda9b886e8ea4582ec6cab3e38ac34a73a6283d Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Fri, 5 Jan 2024 14:31:50 +0100 Subject: [PATCH] add Pdyn for gated modulations --- Classes/BuboArray.sc | 2 +- Classes/PDyn.sc | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Classes/PDyn.sc diff --git a/Classes/BuboArray.sc b/Classes/BuboArray.sc index b947bef..5cf7ecd 100644 --- a/Classes/BuboArray.sc +++ b/Classes/BuboArray.sc @@ -101,7 +101,7 @@ } pwrand { arg weights, repeats=1; - ^Pwrand(this, weights, repeats); + ^Pwrand(this, weights.normalizeSum, repeats); } pwhite { arg repeats=inf; diff --git a/Classes/PDyn.sc b/Classes/PDyn.sc new file mode 100644 index 0000000..be92a54 --- /dev/null +++ b/Classes/PDyn.sc @@ -0,0 +1,10 @@ +Pdyn { + *new { + arg function, hash; + if (hash.isNil) { hash = 10.collect({ + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".choose }) + .join("").asSymbol; + } + ^Pfunc({Ndef(hash, function).asMap}) + } +}