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}) + } +}