Fix operator overriding mess

This commit is contained in:
2024-05-15 16:23:28 +02:00
parent 461cfcbd7a
commit 39ed936b75
4 changed files with 84 additions and 36 deletions

View File

@ -71,4 +71,35 @@ BuboUtils {
each.postln;
});
}
*getValueFromPattern {
arg pattern, key, default;
var keyIndex;
try {
if (pattern == nil, {
^default
});
keyIndex = pattern.indexOf(key);
if (keyIndex.notNil) {
^pattern[keyIndex + 1]
} {
^default
}
} {
^default
}
}
*getQuantFromPattern {
arg pattern;
^this.getValueFromPattern(pattern, 'quant', 4)
}
*getFadeFromPattern {
arg pattern;
^this.getValueFromPattern(pattern, 'fade', 0.01)
}
}