Added random array generator and force eval using Shift+Ctrl+Enter

This commit is contained in:
2023-09-08 17:18:30 +03:00
parent d2161eb5bc
commit 61096a5510
5 changed files with 40 additions and 8 deletions

View File

@ -24,7 +24,7 @@ Every Topos session is composed of several small scripts. A set of scripts is ca
)} to ${key_shortcut("F9")}).
- **the init script** (${key_shortcut(
"Ctrl + I"
)}): _Evaluated on program load_. Used to set up the software the session to the desired state before playing (_bpm_, etc...). You can also access that script using the ${key_shortcut(
)}): _Evaluated on program load_. Used to set up the software the session to the desired state before playing, for example changing bpm or to initialize global variables (See Functions). You can also access that script using the ${key_shortcut(
"F11"
)} key.
- **the note file** (${key_shortcut(

View File

@ -40,9 +40,8 @@ Topos is made to be controlled entirely with a keyboard. It is recommanded to st
| Shortcut | Key | Description |
|----------|-------|------------------------------------------------------------|
|Evaluate|${key_shortcut("Ctrl + Enter")}| Evaluate the current script |
|Local Eval|${key_shortcut("Ctrl + F1")} to ${key_shortcut(
"Ctrl + F9"
)}|Local File Evaluation|
|Local Eval|${key_shortcut("Ctrl + F1")} to ${key_shortcut("Ctrl + F9")}|Local File Evaluation|
|Force Eval|${key_shortcut("Ctrl + Shift + Enter")}|Force evaluation of the current script|
## Special

View File

@ -98,7 +98,7 @@ mod([1,.5,.25].beat()) :: snd('sine')
- <ic>random(index: number)</ic>: pick a random element in the given list.
- <ic>rand(index: number)</ic>: shorter alias for the same method.
- <ic>pick()</ic>: pick a random element in the list.
- <ic>gen(min,max,length)</ic>: generate a list of random numbers between _min_ and _max_ with a given _length_.
${makeExample(
"Sipping some gasoline at the robot bar",
@ -114,6 +114,14 @@ mod([.5, 1].random() / 2) :: snd(
true
)}
${makeExample(
"Generate a list of random numbers",
`
mod(0.5) && sound('arp').freq([].gen(300,600,10).div(3)).out()
`,
true
)}
- <ic>degrade(amount: number)</ic>: removes _n_% of the list elements. Lists can be degraded as long as one element remains. The amount of degradation is given as a percentage.
${makeExample(