From c3018a29a0ad6516c3b743b5e885bf11e30c6015 Mon Sep 17 00:00:00 2001 From: Aria Date: Sun, 11 Jan 2026 19:10:02 -0600 Subject: [PATCH] Update docstring and add an example --- packages/core/controls.mjs | 6 +++++- test/__snapshots__/examples.test.mjs.snap | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 196ebdb5c..7ad510b95 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -3081,6 +3081,10 @@ export const { FXrelease, FXrel, FXr, fxr } = registerControl('FXrelease', 'FXre * Input audio device to be used as a sound source in a pattern * * @name input - * @param {string | Pattern} inputName Name of the input audio device to use + * @param {string | number | Pattern} input Name or index of the input audio device to use + * @example + * // Please be careful about feedback! + * input("1 2").gain(0.5) + * .stretch(0.5).lfo({ s: 0.5 }) */ export const { input } = registerControl('input'); diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index f6547bc61..e6b1c115b 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -5484,6 +5484,19 @@ exports[`runs examples > example "inhabit" example index 1 1`] = ` ] `; +exports[`runs examples > example "input" example index 0 1`] = ` +[ + "[ 0/1 → 1/2 | input:1 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 1/2 → 1/1 | input:2 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 1/1 → 3/2 | input:1 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 3/2 → 2/1 | input:2 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 2/1 → 5/2 | input:1 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 5/2 → 3/1 | input:2 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 3/1 → 7/2 | input:1 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", + "[ 7/2 → 4/1 | input:2 gain:0.5 stretch:0.5 lfo:{0:{control:stretch sync:0.5} __ids:{}} ]", +] +`; + exports[`runs examples > example "inside" example index 0 1`] = ` [ "[ 0/1 → 1/8 | note:D3 ]",