You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -342,20 +342,38 @@ You need to connect the MIDI device you want to use before starting Facet.
342
342
- only play the generated FacetPattern a single time. Without including `once()`, the FacetPattern will regenerate and play back each loop by default.
343
343
- example:
344
344
- `$('example').noise(4096).play().once();`
345
+
---
346
+
-**over** ( _n_loops_ = 1 )
347
+
- distributes all the events that a FacetPattern would fire over `n_loops` so the pattern can last any number of loops before regenerating.
348
+
- works with audio playback, MIDI note/cc/pitchbend, and OSC.
349
+
- example:
350
+
- `$('example').randsamp('808').play(_.ramp(0,1,16)).over(ri(1,4)); // random sample played 16 times over 1,2,3 or 4 bars`
351
+
- `$('example').drunk(2048,0.01).cc().over(128); // drunk walk over 128 bars, creates a drifty process that you can map onto device paramters to slowly randomize something`
345
352
346
353
### Methods for setting variables
347
354
This can be useful when you want to access the same pattern across multiple commands.
348
355
349
356
-**set** ( _name_ )
350
357
- saves a FacetPattern's data in memory, for reference as a variable in operations. Any FacetPatterns stored via `.set()` will only be stored until the server is closed.
351
-
- if a pattern stored with `set()` has more than one piece of data in it, the corresponding variable will be an array. If the pattern has one piece of data in it, the corresponding variable will be a float.
358
+
- if a pattern stored with `set()` has more than one piece of data in it, the corresponding variable will be an array. If the pattern has one piece of data in it, the corresponding variable will be a float.
352
359
- **NOTE**: when you run the `.set()` command for the first time after starting the system, if you're also running commands that reference that variable in the same block, for the first evaluation, the variable will have a value of 0 as it has not fully propagated into the variable storage system.
360
+
- **NOTE**: if you want to set more than one variable, you should run all the `.set()` methods in a single command, so they do not create a race condition for when they are evaluated.
353
361
- example:
354
362
- ```
355
363
$('example').tri(100).set('abc').sine(abc).play(); // run it all in one command - just remember the first evaluated sine will have a frequency of 0
356
364
357
365
$('set_example').noise(32).curve().set('my_var').once(); // first, set the variable here
358
366
$('example').noise(100).times(my_var).play(); // now, you can use my_var in commands
367
+
368
+
// multi-variable example
369
+
// step 1: initialize the patterns by running this with .once()
0 commit comments