From 10c28a7ecf2757a361425b50f4efdd0599132b18 Mon Sep 17 00:00:00 2001 From: Miika Alonen Date: Thu, 14 Dec 2023 22:09:24 +0200 Subject: [PATCH] Added chain log to docs --- src/documentation/patterns/chaining.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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