Fixing density and adding documentation

This commit is contained in:
Raphael Forment 2023-11-17 13:18:49 +01:00
parent 476bda812e
commit fb28083ce6
5 changed files with 22 additions and 4 deletions

View file

@ -1214,6 +1214,17 @@ const generic_params = [
* @name waveloss
*/
['waveloss'],
/*
*
* Noise crackle density
*
* @name density
* @param {number | Pattern} density between 0 and x
* @example
* s("crackle*4").density("<0.01 0.04 0.2 0.5>".slow(4))
*
*/
['density'],
// TODO: midi effects?
['dur'],
// ['modwheel'],
@ -1308,7 +1319,7 @@ const generic_params = [
];
// TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13
controls.createParam = function (names) {
controls.createParam = function(names) {
const name = Array.isArray(names) ? names[0] : names;
var withVal;
@ -1332,7 +1343,7 @@ controls.createParam = function (names) {
const func = (...pats) => sequence(...pats).withValue(withVal);
const setter = function (...pats) {
const setter = function(...pats) {
if (!pats.length) {
return this.fmap(withVal);
}