Skip to content

Commit

Permalink
[v0.5.23] minor fix to the sometimes() function, where it would not w…
Browse files Browse the repository at this point in the history
…ork if nested inside other functions like slices(), iter(), etc where supply a function as an arg
  • Loading branch information
nnirror committed Feb 13, 2023
1 parent 42d4e22 commit cfb9091
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/FacetPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,7 @@ class FacetPattern {
throw `2nd argument must be a function, type found: ${typeof command}`;
}
command = command.toString();
command = command.replace(/current_slice./g, 'this.');
command = command.slice(command.indexOf("{") + 1, command.lastIndexOf("}"));
prob = Math.abs(Number(prob));
if ( Math.random() < prob ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facet",
"version": "0.5.22",
"version": "0.5.23",
"description": "Facet is a live coding system for algorithmic music",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit cfb9091

Please sign in to comment.