diff --git a/src/documentation/patterns/chaining.ts b/src/documentation/patterns/chaining.ts index 3fec4ca..73eb1cc 100644 --- a/src/documentation/patterns/chaining.ts +++ b/src/documentation/patterns/chaining.ts @@ -54,6 +54,25 @@ rhythm(.25, [6, 8].beat(), 12)::sound('sine') true, )} +## Logging values from the chain + +You can use the log() function to print values from the current event. This can be useful to debug your code. Useful parameters to log could be **note**, **pitch**, **dur**, **octave** etc... + +${makeExample( + "Logging values from the chain", + ` + beat(1) :: sound("sine").pitch(rI(1,6)).log("note").out() + `, + true, +)} + +${makeExample( + "Logging values from ziffers pattern", + ` + z1("0 3 2 5").scale("rocritonic").sound("sine").log("pitch","note","key").out() + `, + true, +)} ## Conditional chaining