From 3e1e928afb85b1d6465c3674db5606c8a7f281b8 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Fri, 8 Sep 2023 21:49:12 +0200 Subject: [PATCH 1/3] Fix documentation --- src/documentation/inlineHelp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documentation/inlineHelp.ts b/src/documentation/inlineHelp.ts index 3afcefe..2197311 100644 --- a/src/documentation/inlineHelp.ts +++ b/src/documentation/inlineHelp.ts @@ -351,7 +351,7 @@ const completionDatabase: CompletionDatabase = { name: "binrhythm", category: "rhythm", description: "Binary rhythm generator", - example: "binrhythm(9223) :: sound('cp').out()", + example: "binrhythm(.5, 9223) :: sound('cp').out()", }, prob: { name: "prob", From 5ce89dbaf2b391ff2bc46385872ca3e1881377f8 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 9 Sep 2023 10:40:01 +0200 Subject: [PATCH 2/3] adding toss function to helpers --- src/documentation/inlineHelp.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/documentation/inlineHelp.ts b/src/documentation/inlineHelp.ts index 2197311..828557b 100644 --- a/src/documentation/inlineHelp.ts +++ b/src/documentation/inlineHelp.ts @@ -13,6 +13,12 @@ type CompletionDatabase = { }; const completionDatabase: CompletionDatabase = { + toss: { + name: "toss", + category: "randomness", + description: "Toss a coin, true or false", + example: "toss() : log('heads')" + }, attack: { name: "attack", category: "synthesis", From c684672598f501dcc7d14c8a06f173bce488b971 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Sat, 9 Sep 2023 10:52:05 +0200 Subject: [PATCH 3/3] more helpers --- src/documentation/inlineHelp.ts | 103 ++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 6 deletions(-) diff --git a/src/documentation/inlineHelp.ts b/src/documentation/inlineHelp.ts index 828557b..91be278 100644 --- a/src/documentation/inlineHelp.ts +++ b/src/documentation/inlineHelp.ts @@ -13,12 +13,31 @@ type CompletionDatabase = { }; const completionDatabase: CompletionDatabase = { - toss: { - name: "toss", - category: "randomness", - description: "Toss a coin, true or false", - example: "toss() : log('heads')" - }, + odds: { + name: "odds", + category: "patterns", + description: + "returns true for every n (odds) in given seconds (sec)", + example: "odds(1, 2) // true every 2 seconds", + }, + seed: { + name: "seed", + category: "randomness", + description: "Seed the random generator", + example: "seed(1234)", + }, + delayr: { + name: "delayr", + category: "time", + description: "Delay a function n times by t ms", + example: "delayr(50, 3, () => mod(1) :: log('delayed'))", + }, + toss: { + name: "toss", + category: "randomness", + description: "Toss a coin, true or false", + example: "toss() : log('heads')", + }, attack: { name: "attack", category: "synthesis", @@ -414,6 +433,18 @@ const completionDatabase: CompletionDatabase = { description: "Execute one or more local scripts", example: "mod(1) :: script(1)", }, + clear_script: { + name: "clear_script", + category: "core", + description: "Deletes the given script", + example: "clear_script(2)", + }, + copy_script: { + name: "copy_script", + category: "core", + description: "Copy the script from to the script to", + example: "copy_script(1, 2)", + }, warp: { name: "warp", category: "core", @@ -607,6 +638,54 @@ const completionDatabase: CompletionDatabase = { description: "Iterator", example: "[0,1,2,3].loop($(1))", }, + counter: { + name: "counter", + category: "patterns", + description: "Counter/iterator", + example: "counter('my_counter_, 20, 1)", + }, + drunk: { + name: "drunk", + category: "patterns", + description: "Returns the next value in a drunk walk", + example: "drunk()", + }, + drunk_max: { + name: "drunk_max", + category: "patterns", + description: "Sets the maximum value of the drunk walk", + example: "drunk_max(10)", + }, + drunk_min: { + name: "drunk_min", + category: "patterns", + description: "Sets the minimum value of the drunk walk", + example: "drunk_min(0)", + }, + drunk_wrap: { + name: "drunk_wrap", + category: "patterns", + description: "Wraps (or not) of the drunk walk (boolean)", + example: "drunk_wrap(true)", + }, + v: { + name: "v", + category: "variable", + description: "Global Variable setter or getter", + example: "v('my_var', 10) // Sets global variable 'my_var' to 10", + }, + delete_variable: { + name: "delete_variable", + category: "variable", + description: "Deletes the given global variable", + example: "delete_variable('my_var')", + }, + clear_variables: { + name: "clear_variables", + category: "variable", + description: "Clears all global variables", + example: "clear_variables()", + }, shuffle: { name: "shuffle", category: "patterns", @@ -649,6 +728,18 @@ const completionDatabase: CompletionDatabase = { description: "Divide each element of the given array by a value", example: "[0,1,2,3].division(2)", }, + scale: { + name: "scale", + category: "patterns", + description: "Scale setter used by Ziffers", + example: "z0('0 1 2 3').scale('major').out()", + }, + zzfx: { + name: "zzfx", + category: "synthesis", + description: "ZzFX sound generator", + example: "sound('zzfx').zzfx(...).out()", + }, }; export const inlineHoveringTips = hoverTooltip(