Merge branch 'dev' of github.com:Bubobubobubobubo/Topos into dev

This commit is contained in:
2023-08-28 21:49:13 +02:00

View File

@ -1809,8 +1809,40 @@ Topos is made to be controlled entirely with a keyboard. It is recommanded to st
const chaining: string = `
# Chaining
Method chaining can be used to manipulate object returned by both <icode>sound()</icode> and <icode>midi()</icode> functions. Probability functions are chained to apply different functions randomly. Probability functions are named as global probability functions (see Probabilities), but take a function as an input.
## Chaining sound events
All functions from the sound object can be used to modify the event, for example:
${makeExample(
"Modifying sound events with probabilities", 
`mod(.5) && sound('hh')
.odds(1/4, s => s.speed(irand(1,4)))
.rarely(s => s.crush(3))
.out()`, true)};
${makeExample(
"Modifying sound events with probabilities", 
`mod(.5) && sound('tink').note(60)
.often(s => s.note(62))
.sometimes(s => s.note(64).n(irand(1,4)))
.out()`, true)};
## Chaining midi events
All functions from the midi object can be used to modify the event with the probabilities. Values can also be incremented using += notation.
${makeExample(
"Modifying midi events with probabilities", 
`mod(.5) && midi(60).channel(1)
.odds(1/4, n => n.channel(2))
.often(n => n.note+=4)
.sometimes(s => s.velocity(irand(50,100))
.out()`, true)};
## Ziffers
Ziffers patterns can be chained to <icode>sound()</icode> and <icode>midi()</icode> to produce different outputs. Chaining is often alternative for passing in options, which can be more efficient. Methods available for chaining are:
* <icode>key()</icode> - for changing key
* <icode>scale()</icode> - for chaning scale
@ -1818,7 +1850,6 @@ Ziffers patterns can be chained to <icode>sound()</icode> and <icode>midi()</ico
* <icode>sound()</icode> - for outputting pattern as sounds (See Sound)
* <icode>midi()</icode> - for outputting pattern as midi (See Midi)
`;
return {