From 58104b5a3a24c91c3f8e6d5f5cc0b82287d3101a Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 22 May 2022 11:53:29 +0200 Subject: [PATCH] document more controls --- doc.json | 439 +++++++++++++++++++++++++++++++------ packages/core/controls.mjs | 114 +++++++++- 2 files changed, 491 insertions(+), 62 deletions(-) diff --git a/doc.json b/doc.json index 2c90c62c..2ffe2425 100644 --- a/doc.json +++ b/doc.json @@ -1,7 +1,7 @@ { "docs": [ { - "comment": "/**\n * Select a sound / sample by name. Currently only supported by osc / superdirt.\n *\n * @name s\n * @param {string | Pattern} sound The sound / pattern of sounds to pick\n * @example\n * s(\"bd hh\").osc()\n *\n */", + "comment": "/**\n * Select a sound / sample by name. Currently only supported by osc / superdirt.\n * See default sounds here: https://tidalcycles.org/docs/configuration/Audio%20Samples/default_library\n *\n * @name s\n * @param {string | Pattern} sound The sound / pattern of sounds to pick\n * @example\n * s(\"bd hh\").osc()\n *\n */", "meta": { "filename": "controls.mjs", "lineno": 11, @@ -9,7 +9,7 @@ "path": "/home/felix/projects/strudel/packages/core", "code": {} }, - "description": "

Select a sound / sample by name. Currently only supported by osc / superdirt.

", + "description": "

Select a sound / sample by name. Currently only supported by osc / superdirt.\nSee default sounds here: https://tidalcycles.org/docs/configuration/Audio%20Samples/default_library

", "name": "s", "params": [ { @@ -33,10 +33,10 @@ "___s": true }, { - "comment": "/**\n * A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.\n *\n * @name accelerate\n * @param {number | Pattern} amount acceleration.\n * @example\n * s(\"bd\").accelerate(\"<1 2 1 4>\").osc()\n *\n */", + "comment": "/**\n * A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.\n *\n * @name accelerate\n * @param {number | Pattern} amount acceleration.\n * @example\n * s(\"sax\").accelerate(\"<0 1 2 4 8 16>\").slow(2).osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 24, + "lineno": 25, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -56,7 +56,7 @@ } ], "examples": [ - "s(\"bd\").accelerate(\"<1 2 1 4>\").osc()" + "s(\"sax\").accelerate(\"<0 1 2 4 8 16>\").slow(2).osc()" ], "longname": "accelerate", "kind": "member", @@ -68,7 +68,7 @@ "comment": "/**\n * Like {@link gain}, but linear.\n *\n * @name amp\n * @param {number | Pattern} amount gain.\n * @example\n * s(\"bd*8\").amp(\".1*2 .5 .1*2 .5 .1 .5\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 34, + "lineno": 35, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -100,7 +100,7 @@ "comment": "/**\n * A pattern of numbers to specify the attack time of an envelope applied to each sample.\n *\n * @name attack\n * @param {number | Pattern} attack time in seconds.\n * @example\n * n(\"c5 e5\").s('superpiano').attack(\"<0 .1>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 45, + "lineno": 46, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -132,7 +132,7 @@ "comment": "/**\n * Sets the center frequency of the band-pass filter.\n *\n * @name bandf\n * @param {number | Pattern} frequency center frequency\n * @example\n * s(\"bd sd\").bandf(\"<1000 2000 4000 8000>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 60, + "lineno": 61, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -160,6 +160,323 @@ "___id": "T000002R000008", "___s": true }, + { + "comment": "/**\n * Sets the q-factor of the band-pass filter\n *\n * @name bandq\n * @param {number | Pattern} q q factor\n * @example\n * s(\"bd sd\").bandf(\"<1000 2000 4000 8000>\").bandq(\"<.2 .9>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 72, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

Sets the q-factor of the band-pass filter

", + "name": "bandq", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

q factor

", + "name": "q" + } + ], + "examples": [ + "s(\"bd sd\").bandf(\"<1000 2000 4000 8000>\").bandq(\"<.2 .9>\").osc()" + ], + "longname": "bandq", + "kind": "member", + "scope": "global", + "___id": "T000002R000009", + "___s": true + }, + { + "comment": "/**\n * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.\n *\n * @name begin\n * @param {number | Pattern} amount between 0 and 1, where 1 is the length of the sample\n * @example\n * s(\"rave\").begin(\"<0 .25 .5 .75>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 82, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. 0.25 to cut off the first quarter from each sample.

", + "name": "begin", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

between 0 and 1, where 1 is the length of the sample

", + "name": "amount" + } + ], + "examples": [ + "s(\"rave\").begin(\"<0 .25 .5 .75>\").osc()" + ], + "longname": "begin", + "kind": "member", + "scope": "global", + "___id": "T000002R000010", + "___s": true + }, + { + "comment": "/**\n * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.\n *\n * @name legato\n * @param {number | Pattern} duration between 0 and 1, where 1 is the length of the whole hap time\n * @example\n * \"c4 eb4 g4 bb4\".legato(\"<0.125 .25 .5 .75 1 2 4>\")\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 97, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. 0.25 to cut off the first quarter from each sample.

", + "name": "legato", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

between 0 and 1, where 1 is the length of the whole hap time

", + "name": "duration" + } + ], + "examples": [ + "\"c4 eb4 g4 bb4\".legato(\"<0.125 .25 .5 .75 1 2 4>\")" + ], + "longname": "legato", + "kind": "member", + "scope": "global", + "___id": "T000002R000011", + "___s": true + }, + { + "comment": "/**\n * bit crusher effect.\n *\n * @name crush\n * @param {number | Pattern} depth between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).\n * @example\n * s(\",hh*3,jvbass*2\").fast(2).crush(\"<16 8 7 6 5 4 3 2>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 108, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

bit crusher effect.

", + "name": "crush", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).

", + "name": "depth" + } + ], + "examples": [ + "s(\",hh*3,jvbass*2\").fast(2).crush(\"<16 8 7 6 5 4 3 2>\").osc()" + ], + "longname": "crush", + "kind": "member", + "scope": "global", + "___id": "T000002R000012", + "___s": true + }, + { + "comment": "/**\n * fake-resampling for lowering the sample rate\n *\n * @name coarse\n * @param {number | Pattern} factor 1 for original 2 for half, 3 for a third and so on.\n * @example\n * s(\"xmas\").coarse(\"<1 4 8 16 32>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 122, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

fake-resampling for lowering the sample rate

", + "name": "coarse", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

1 for original 2 for half, 3 for a third and so on.

", + "name": "factor" + } + ], + "examples": [ + "s(\"xmas\").coarse(\"<1 4 8 16 32>\").osc()" + ], + "longname": "coarse", + "kind": "member", + "scope": "global", + "___id": "T000002R000013", + "___s": true + }, + { + "comment": "/**\n * choose the channel the pattern is sent to in superdirt\n *\n * @name channel\n * @param {number | Pattern} channel channel number\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 137, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

choose the channel the pattern is sent to in superdirt

", + "name": "channel", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

channel number

", + "name": "channel" + } + ], + "longname": "channel", + "kind": "member", + "scope": "global", + "___id": "T000002R000014", + "___s": true + }, + { + "comment": "/**\n * In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.\n *\n * @name cut\n * @param {number | Pattern} group cut group number\n * @example\n * s(\"bd sax\").cut(1).osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 145, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

In the style of classic drum-machines, cut will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.

", + "name": "cut", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

cut group number

", + "name": "group" + } + ], + "examples": [ + "s(\"bd sax\").cut(1).osc()" + ], + "longname": "cut", + "kind": "member", + "scope": "global", + "___id": "T000002R000015", + "___s": true + }, + { + "comment": "/**\n * Applies the cutoff frequency of the low-pass filter.\n *\n * @name cutoff\n * @param {number | Pattern} frequency audible between 0 and 20000\n * @example\n * s(\"bd,hh*2,<~ sd>\").fast(2).cutoff(\"<4000 2000 1000 500 200 100>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 159, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

Applies the cutoff frequency of the low-pass filter.

", + "name": "cutoff", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

audible between 0 and 20000

", + "name": "frequency" + } + ], + "examples": [ + "s(\"bd,hh*2,<~ sd>\").fast(2).cutoff(\"<4000 2000 1000 500 200 100>\").osc()" + ], + "longname": "cutoff", + "kind": "member", + "scope": "global", + "___id": "T000002R000016", + "___s": true + }, + { + "comment": "/** \n * Set detune of oscillators. Works only with some synths, see tidal doc\n *\n * @name detune\n * @param {number | Pattern} amount between 0 and 1\n * @example\n * n(\"0 3 7\").s('superzow').octave(3).detune(\"<0 .25 .5 1 2>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 194, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

Set detune of oscillators. Works only with some synths, see tidal doc

", + "name": "detune", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

between 0 and 1

", + "name": "amount" + } + ], + "examples": [ + "n(\"0 3 7\").s('superzow').octave(3).detune(\"<0 .25 .5 1 2>\").osc()" + ], + "longname": "detune", + "kind": "member", + "scope": "global", + "___id": "T000002R000017", + "___s": true + }, + { + "comment": "/** \n * Set detune of oscillators. Works only with some synths, see tidal doc\n *\n * @name djf\n * @param {number | Pattern} cutoff below 0.5 is low pass filter, above is high pass filter\n * @example\n * n(\"0 3 7 [10,24]\").s('superzow').octave(3).djf(\"<.5 .25 .5 .75>\").osc()\n *\n */", + "meta": { + "filename": "controls.mjs", + "lineno": 204, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "

Set detune of oscillators. Works only with some synths, see tidal doc

", + "name": "djf", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "

below 0.5 is low pass filter, above is high pass filter

", + "name": "cutoff" + } + ], + "examples": [ + "n(\"0 3 7 [10,24]\").s('superzow').octave(3).djf(\"<.5 .25 .5 .75>\").osc()" + ], + "longname": "djf", + "kind": "member", + "scope": "global", + "___id": "T000002R000018", + "___s": true + }, { "comment": "/**\n * Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span.\n * Should only be used with single characters as values, otherwise the character slots will be messed up.\n * Character legend:\n *\n * - \"|\" cycle separator\n * - \"-\" hold previous value\n * - \".\" silence\n *\n * @param {Pattern} pattern the pattern to use\n * @param {number} chars max number of characters (approximately)\n * @returns string\n * @example\n * const line = drawLine(\"0 [1 2 3]\", 10); // |0--123|0--123\n * console.log(line);\n */", "meta": { @@ -229,7 +546,7 @@ "longname": "drawLine", "kind": "function", "scope": "global", - "___id": "T000002R000015", + "___id": "T000002R000025", "___s": true }, { @@ -318,7 +635,7 @@ "longname": "Pattern#euclid", "kind": "function", "scope": "instance", - "___id": "T000002R000039", + "___id": "T000002R000049", "___s": true }, { @@ -355,7 +672,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000040", + "___id": "T000002R000050", "___s": true }, { @@ -393,7 +710,7 @@ "name": "query" } ], - "___id": "T000002R000500", + "___id": "T000002R000510", "___s": true }, { @@ -456,7 +773,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000502", + "___id": "T000002R000512", "___s": true }, { @@ -492,7 +809,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000503", + "___id": "T000002R000513", "___s": true }, { @@ -540,7 +857,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000506", + "___id": "T000002R000516", "___s": true }, { @@ -588,7 +905,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000507", + "___id": "T000002R000517", "___s": true }, { @@ -635,7 +952,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000508", + "___id": "T000002R000518", "___s": true }, { @@ -683,7 +1000,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000509", + "___id": "T000002R000519", "___s": true }, { @@ -730,7 +1047,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000510", + "___id": "T000002R000520", "___s": true }, { @@ -777,7 +1094,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000511", + "___id": "T000002R000521", "___s": true }, { @@ -824,7 +1141,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000512", + "___id": "T000002R000522", "___s": true }, { @@ -871,7 +1188,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000513", + "___id": "T000002R000523", "___s": true }, { @@ -907,7 +1224,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000514", + "___id": "T000002R000524", "___s": true }, { @@ -963,7 +1280,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000515", + "___id": "T000002R000525", "___s": true }, { @@ -1010,7 +1327,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000549", + "___id": "T000002R000559", "___s": true }, { @@ -1043,7 +1360,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000550", + "___id": "T000002R000560", "___s": true }, { @@ -1091,7 +1408,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000551", + "___id": "T000002R000561", "___s": true }, { @@ -1138,7 +1455,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000552", + "___id": "T000002R000562", "___s": true }, { @@ -1174,7 +1491,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000553", + "___id": "T000002R000563", "___s": true }, { @@ -1210,7 +1527,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000554", + "___id": "T000002R000564", "___s": true }, { @@ -1246,7 +1563,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000555", + "___id": "T000002R000565", "___s": true }, { @@ -1293,7 +1610,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000563", + "___id": "T000002R000573", "___s": true }, { @@ -1340,7 +1657,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000565", + "___id": "T000002R000575", "___s": true }, { @@ -1387,7 +1704,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000577", + "___id": "T000002R000587", "___s": true }, { @@ -1436,7 +1753,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000589", + "___id": "T000002R000599", "___s": true }, { @@ -1467,7 +1784,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000592", + "___id": "T000002R000602", "___s": true }, { @@ -1498,7 +1815,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000593", + "___id": "T000002R000603", "___s": true }, { @@ -1534,7 +1851,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000594", + "___id": "T000002R000604", "___s": true }, { @@ -1570,7 +1887,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000613", + "___id": "T000002R000623", "___s": true }, { @@ -1606,7 +1923,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000614", + "___id": "T000002R000624", "___s": true }, { @@ -1642,7 +1959,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000615", + "___id": "T000002R000625", "___s": true }, { @@ -1678,7 +1995,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000616", + "___id": "T000002R000626", "___s": true }, { @@ -1714,7 +2031,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000617", + "___id": "T000002R000627", "___s": true }, { @@ -1770,7 +2087,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000618", + "___id": "T000002R000628", "___s": true }, { @@ -1826,7 +2143,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000619", + "___id": "T000002R000629", "___s": true }, { @@ -1882,7 +2199,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000620", + "___id": "T000002R000630", "___s": true }, { @@ -1918,7 +2235,7 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000717", + "___id": "T000002R000727", "___s": true }, { @@ -1969,7 +2286,7 @@ "longname": "pure", "kind": "function", "scope": "global", - "___id": "T000002R000835", + "___id": "T000002R000845", "___s": true }, { @@ -2021,7 +2338,7 @@ "longname": "stack", "kind": "function", "scope": "global", - "___id": "T000002R000842", + "___id": "T000002R000852", "___s": true }, { @@ -2073,7 +2390,7 @@ "longname": "slowcat", "kind": "function", "scope": "global", - "___id": "T000002R000846", + "___id": "T000002R000856", "___s": true }, { @@ -2122,7 +2439,7 @@ "longname": "slowcatPrime", "kind": "function", "scope": "global", - "___id": "T000002R000854", + "___id": "T000002R000864", "___s": true }, { @@ -2174,7 +2491,7 @@ "longname": "fastcat", "kind": "function", "scope": "global", - "___id": "T000002R000860", + "___id": "T000002R000870", "___s": true }, { @@ -2202,7 +2519,7 @@ "longname": "cat", "kind": "function", "scope": "global", - "___id": "T000002R000862", + "___id": "T000002R000872", "___s": true }, { @@ -2254,7 +2571,7 @@ "longname": "timeCat", "kind": "function", "scope": "global", - "___id": "T000002R000864", + "___id": "T000002R000874", "___s": true }, { @@ -2282,7 +2599,7 @@ "longname": "sequence", "kind": "function", "scope": "global", - "___id": "T000002R000871", + "___id": "T000002R000881", "___s": true }, { @@ -2310,7 +2627,7 @@ "longname": "seq", "kind": "function", "scope": "global", - "___id": "T000002R000873", + "___id": "T000002R000883", "___s": true }, { @@ -2349,7 +2666,7 @@ "scope": "static", "longname": "Pattern.transpose", "kind": "member", - "___id": "T000002R003682", + "___id": "T000002R003692", "___s": true }, { @@ -2386,7 +2703,7 @@ "scope": "static", "longname": "Pattern.scaleTranspose", "kind": "member", - "___id": "T000002R003686", + "___id": "T000002R003696", "___s": true }, { @@ -2423,7 +2740,7 @@ "scope": "static", "longname": "Pattern.scale", "kind": "member", - "___id": "T000002R003688", + "___id": "T000002R003698", "___s": true }, { @@ -2460,7 +2777,7 @@ "scope": "static", "longname": "Pattern.voicings", "kind": "member", - "___id": "T000002R003713", + "___id": "T000002R003723", "___s": true }, { @@ -2542,7 +2859,7 @@ "/home/felix/projects/strudel/packages/xen/tunejs.js", "/home/felix/projects/strudel/packages/xen/xen.mjs" ], - "___id": "T000002R013982", + "___id": "T000002R013992", "___s": true } ] diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 83c75455..a34784e4 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -10,6 +10,7 @@ const controls = {}; const generic_params = [ /** * Select a sound / sample by name. Currently only supported by osc / superdirt. + * See default sounds here: https://tidalcycles.org/docs/configuration/Audio%20Samples/default_library * * @name s * @param {string | Pattern} sound The sound / pattern of sounds to pick @@ -27,7 +28,7 @@ const generic_params = [ * @name accelerate * @param {number | Pattern} amount acceleration. * @example - * s("bd").accelerate("<1 2 1 4>").osc() + * s("sax").accelerate("<0 1 2 4 8 16>").slow(2).osc() * */ ['f', 'accelerate', 'a pattern of numbers that speed up (or slow down) samples while they play.'], @@ -67,37 +68,148 @@ const generic_params = [ * */ ['f', 'bandf', 'A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter.'], + // TODO: in tidal, it seems to be normalized + /** + * Sets the q-factor of the band-pass filter + * + * @name bandq + * @param {number | Pattern} q q factor + * @example + * s("bd sd").bandf("<1000 2000 4000 8000>").bandq("<.2 .9>").osc() + * + */ ['f', 'bandq', 'a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter.'], + /** + * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample. + * + * @name begin + * @param {number | Pattern} amount between 0 and 1, where 1 is the length of the sample + * @example + * s("rave").begin("<0 .25 .5 .75>").osc() + * + */ [ 'f', 'begin', 'a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample.', ], + // TODO: currently duplicated with "native" legato + /** + * a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample. + * + * @name legato + * @param {number | Pattern} duration between 0 and 1, where 1 is the length of the whole hap time + * @example + * "c4 eb4 g4 bb4".legato("<0.125 .25 .5 .75 1 2 4>") + * + */ ['f', 'legato', 'controls the amount of overlap between two adjacent sounds'], // ['f', 'clhatdecay', ''], + /** + * bit crusher effect. + * + * @name crush + * @param {number | Pattern} depth between 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction). + * @example + * s(",hh*3,jvbass*2").fast(2).crush("<16 8 7 6 5 4 3 2>").osc() + * + */ [ 'f', 'crush', 'bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).', ], + /** + * fake-resampling for lowering the sample rate + * + * @name coarse + * @param {number | Pattern} factor 1 for original 2 for half, 3 for a third and so on. + * @example + * s("xmas").coarse("<1 4 8 16 32>").osc() + * + */ [ 'f', 'coarse', 'fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on.', ], + + /** + * choose the channel the pattern is sent to in superdirt + * + * @name channel + * @param {number | Pattern} channel channel number + * + */ ['i', 'channel', 'choose the channel the pattern is sent to in superdirt'], + /** + * In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open. + * + * @name cut + * @param {number | Pattern} group cut group number + * @example + * s("bd sax").cut(1).osc() + * + */ [ 'i', 'cut', 'In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.', ], + /** + * Applies the cutoff frequency of the low-pass filter. + * + * @name cutoff + * @param {number | Pattern} frequency audible between 0 and 20000 + * @example + * s("bd,hh*2,<~ sd>").fast(2).cutoff("<4000 2000 1000 500 200 100>").osc() + * + */ ['f', 'cutoff', 'a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.'], // ['f', 'cutoffegint', ''], + // TODO: find out how this works? + /* + * Envelope decay time = the time it takes after the attack time to reach the sustain level. + * + * @name decay + * @param {number | Pattern} time decay time in seconds + * @example + * s("sax").cut(1).decay("<.1 .2 .3 .4>").sustain(0).osc() + * + */ ['f', 'decay', ''], + // TODO: does not seem to work + /* + * Sets the level of the delay signal. + * + * @name delay + * @param {number | Pattern} level between 0 and 1 + * @example + * s("bd").delay("<0 .5 .75 1>").osc() + * + */ ['f', 'delay', 'a pattern of numbers from 0 to 1. Sets the level of the delay signal.'], ['f', 'delayfeedback', 'a pattern of numbers from 0 to 1. Sets the amount of delay feedback.'], ['f', 'delaytime', 'a pattern of numbers from 0 to 1. Sets the length of the delay.'], + /** + * Set detune of oscillators. Works only with some synths, see tidal doc + * + * @name detune + * @param {number | Pattern} amount between 0 and 1 + * @example + * n("0 3 7").s('superzow').octave(3).detune("<0 .25 .5 1 2>").osc() + * + */ ['f', 'detune', ''], + /** + * Set detune of oscillators. Works only with some synths, see tidal doc + * + * @name djf + * @param {number | Pattern} cutoff below 0.5 is low pass filter, above is high pass filter + * @example + * n("0 3 7 [10,24]").s('superzow').octave(3).djf("<.5 .25 .5 .75>").osc() + * + */ ['f', 'djf', 'DJ filter, below 0.5 is low pass filter, above is high pass filter.'], [ 'f',