diff --git a/doc.json b/doc.json
index 6d717503..53b3f510 100644
--- a/doc.json
+++ b/doc.json
@@ -1,7 +1,7 @@
{
"docs": [
{
- "comment": "/**\n * Select a sound / sample by name.\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 */",
+ "comment": "/**\n * Select a sound / sample by name.\n * \n * show all sounds
\n * \n * 808 (6) 808bd (25) 808cy (25) 808hc (5) 808ht (5) 808lc (5) 808lt (5) 808mc (5) 808mt (5) 808oh (5) 808sd (25) 909 (1) ab (12) ade (10) ades2 (9) ades3 (7) ades4 (6) alex (2) alphabet (26) amencutup (32) armora (7) arp (2) arpy (11) auto (11) baa (7) baa2 (7) bass (4) bass0 (3) bass1 (30) bass2 (5) bass3 (11) bassdm (24) bassfoo (3) battles (2) bd (24) bend (4) bev (2) bin (2) birds (10) birds3 (19) bleep (13) blip (2) blue (2) bottle (13) breaks125 (2) breaks152 (1) breaks157 (1) breaks165 (1) breath (1) bubble (8) can (14) casio (3) cb (1) cc (6) chin (4) circus (3) clak (2) click (4) clubkick (5) co (4) coins (1) control (2) cosmicg (15) cp (2) cr (6) crow (4) d (4) db (13) diphone (38) diphone2 (12) dist (16) dork2 (4) dorkbot (2) dr (42) dr2 (6) dr55 (4) dr_few (8) drum (6) drumtraks (13) e (8) east (9) electro1 (13) em2 (6) erk (1) f (1) feel (7) feelfx (8) fest (1) fire (1) flick (17) fm (17) foo (27) future (17) gab (10) gabba (4) gabbaloud (4) gabbalouder (4) glasstap (3) glitch (8) glitch2 (8) gretsch (24) gtr (3) h (7) hand (17) hardcore (12) hardkick (6) haw (6) hc (6) hh (13) hh27 (13) hit (6) hmm (1) ho (6) hoover (6) house (8) ht (16) if (5) ifdrums (3) incoming (8) industrial (32) insect (3) invaders (18) jazz (8) jungbass (20) jungle (13) juno (12) jvbass (13) kicklinn (1) koy (2) kurt (7) latibro (8) led (1) less (4) lighter (33) linnhats (6) lt (16) made (7) made2 (1) mash (2) mash2 (4) metal (10) miniyeah (4) monsterb (6) moog (7) mouth (15) mp3 (4) msg (9) mt (16) mute (28) newnotes (15) noise (1) noise2 (8) notes (15) numbers (9) oc (4) odx (15) off (1) outdoor (6) pad (3) padlong (1) pebbles (1) perc (6) peri (15) pluck (17) popkick (10) print (11) proc (2) procshort (8) psr (30) rave (8) rave2 (4) ravemono (2) realclaps (4) reverbkick (1) rm (2) rs (1) sax (22) sd (2) seawolf (3) sequential (8) sf (18) sheffield (1) short (5) sid (12) sine (6) sitar (8) sn (52) space (18) speakspell (12) speech (7) speechless (10) speedupdown (9) stab (23) stomp (10) subroc3d (11) sugar (2) sundance (6) tabla (26) tabla2 (46) tablex (3) tacscan (22) tech (13) techno (7) tink (5) tok (4) toys (13) trump (11) ul (10) ulgab (5) uxay (3) v (6) voodoo (5) wind (10) wobble (1) world (3) xmas (1) yeah (31)\n * \n * more info\n * \n *
Select a sound / sample by name.\nSee default sounds here: https://tidalcycles.org/docs/configuration/Audio%20Samples/default_library
", + "description": "Select a sound / sample by name.
\n808 (6) 808bd (25) 808cy (25) 808hc (5) 808ht (5) 808lc (5) 808lt (5) 808mc (5) 808mt (5) 808oh (5) 808sd (25) 909 (1) ab (12) ade (10) ades2 (9) ades3 (7) ades4 (6) alex (2) alphabet (26) amencutup (32) armora (7) arp (2) arpy (11) auto (11) baa (7) baa2 (7) bass (4) bass0 (3) bass1 (30) bass2 (5) bass3 (11) bassdm (24) bassfoo (3) battles (2) bd (24) bend (4) bev (2) bin (2) birds (10) birds3 (19) bleep (13) blip (2) blue (2) bottle (13) breaks125 (2) breaks152 (1) breaks157 (1) breaks165 (1) breath (1) bubble (8) can (14) casio (3) cb (1) cc (6) chin (4) circus (3) clak (2) click (4) clubkick (5) co (4) coins (1) control (2) cosmicg (15) cp (2) cr (6) crow (4) d (4) db (13) diphone (38) diphone2 (12) dist (16) dork2 (4) dorkbot (2) dr (42) dr2 (6) dr55 (4) dr_few (8) drum (6) drumtraks (13) e (8) east (9) electro1 (13) em2 (6) erk (1) f (1) feel (7) feelfx (8) fest (1) fire (1) flick (17) fm (17) foo (27) future (17) gab (10) gabba (4) gabbaloud (4) gabbalouder (4) glasstap (3) glitch (8) glitch2 (8) gretsch (24) gtr (3) h (7) hand (17) hardcore (12) hardkick (6) haw (6) hc (6) hh (13) hh27 (13) hit (6) hmm (1) ho (6) hoover (6) house (8) ht (16) if (5) ifdrums (3) incoming (8) industrial (32) insect (3) invaders (18) jazz (8) jungbass (20) jungle (13) juno (12) jvbass (13) kicklinn (1) koy (2) kurt (7) latibro (8) led (1) less (4) lighter (33) linnhats (6) lt (16) made (7) made2 (1) mash (2) mash2 (4) metal (10) miniyeah (4) monsterb (6) moog (7) mouth (15) mp3 (4) msg (9) mt (16) mute (28) newnotes (15) noise (1) noise2 (8) notes (15) numbers (9) oc (4) odx (15) off (1) outdoor (6) pad (3) padlong (1) pebbles (1) perc (6) peri (15) pluck (17) popkick (10) print (11) proc (2) procshort (8) psr (30) rave (8) rave2 (4) ravemono (2) realclaps (4) reverbkick (1) rm (2) rs (1) sax (22) sd (2) seawolf (3) sequential (8) sf (18) sheffield (1) short (5) sid (12) sine (6) sitar (8) sn (52) space (18) speakspell (12) speech (7) speechless (10) speedupdown (9) stab (23) stomp (10) subroc3d (11) sugar (2) sundance (6) tabla (26) tabla2 (46) tablex (3) tacscan (22) tech (13) techno (7) tink (5) tok (4) toys (13) trump (11) ul (10) ulgab (5) uxay (3) v (6) voodoo (5) wind (10) wobble (1) world (3) xmas (1) yeah (31)
\n\nbetween 0 and 1
", - "name": "dry" + "name": "wet" } ], "examples": [ @@ -773,7 +773,7 @@ "comment": "/**\n * Rate of modulation / rotation for leslie effect\n *\n * @name lrate\n * @param {number | Pattern} rate 6.7 for fast, 0.7 for slow\n * @example\n * n(\"0,4,7\").s(\"supersquare\").leslie(1).lrate(\"<1 2 4 8>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 409, + "lineno": 418, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -805,7 +805,7 @@ "comment": "/**\n * Physical size of the cabinet in meters. Be careful, it might be slightly larger than your computer. Affects the Doppler amount (pitch warble)\n *\n * @name lsize\n * @param {number | Pattern} meters somewhere between 0 and 1\n * @example\n * n(\"0,4,7\").s(\"supersquare\").leslie(1).lrate(2).lsize(\"<.1 .5 1>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 420, + "lineno": 429, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -837,7 +837,7 @@ "comment": "/**\n * Sets the default octave of a synth.\n *\n * @name octave\n * @param {number | Pattern} octave octave number\n * @example\n * n(\"0,4,7\").s('supersquare').octave(\"<3 4 5 6>\").osc()\n */", "meta": { "filename": "controls.mjs", - "lineno": 455, + "lineno": 464, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -869,7 +869,7 @@ "comment": "/**\n * a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around.\n *\n * @name orbit\n * @param {number | Pattern} number\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 467, + "lineno": 476, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -897,7 +897,7 @@ "comment": "/**\n * Sets position in stereo.\n *\n * @name pan\n * @param {number | Pattern} pan between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)\n * @example\n * s(\"[bd hh]*2\").pan(\"<.5 1 .5 0>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 481, + "lineno": 490, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -929,7 +929,7 @@ "comment": "/**\n * Sets the level of reverb.\n *\n * @name room\n * @param {number | Pattern} level between 0 and 1\n * @example\n * s(\"bd sd\").room(\"<0 .2 .4 .6 .8 1>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 548, + "lineno": 557, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -961,7 +961,7 @@ "comment": "/**\n * Sets the room size of the reverb, see {@link room}.\n *\n * @name size\n * @param {number | Pattern} size between 0 and 1\n * @example\n * s(\"bd sd\").room(.8).size(\"<0 .2 .4 .6 .8 1>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 558, + "lineno": 567, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -993,7 +993,7 @@ "comment": "/**\n * Wave shaping distortion. CAUTION: it might get loud\n *\n * @name shape\n * @param {number | Pattern} distortion between 0 and 1\n * @example\n * s(\"bd sd\").shape(\"<0 .2 .4 .6 .8 1>\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 576, + "lineno": 588, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -1025,7 +1025,7 @@ "comment": "/**\n * Changes the speed of sample playback, i.e. a cheap way of changing pitch.\n *\n * @name speed\n * @param {number | Pattern} speed -inf to inf, negative numbers play the sample backwards.\n * @example\n * s(\"bd\").speed(\"<1 2 4 1 -2 -4>\").osc()\n * @example\n * speed(\"1 1.5*2 [2 1.1]\").s(\"sax\").cut(1).osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 590, + "lineno": 602, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -1058,7 +1058,7 @@ "comment": "/**\n * Used in conjunction with {@link speed}, accepts values of \"r\" (rate, default behavior), \"c\" (cycles), or \"s\" (seconds). Using `unit \"c\"` means `speed` will be interpreted in units of cycles, e.g. `speed \"1\"` means samples will be stretched to fill a cycle. Using `unit \"s\"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.\n *\n * @name unit\n * @param {number | string | Pattern} unit see description above\n * @example\n * speed(\"1 2 .5 3\").s(\"bd\").unit(\"c\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 606, + "lineno": 618, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -1091,7 +1091,7 @@ "comment": "/**\n * Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:\n *\n * \"A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated.\"\n *\n * @name squiz\n * @param {number | Pattern} squiz Try passing multiples of 2 to it - 2, 4, 8 etc.\n * @example\n * squiz(\"2 4/2 6 [8 16]\").s(\"bd\").osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 620, + "lineno": 632, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -1123,7 +1123,7 @@ "comment": "/**\n *\n * Formant filter to make things sound like vowels.\n *\n * @name vowel\n * @param {string | Pattern} vowel You can use a e i o u. Use a rest (~) to override the effect\n * @example\n * vowel(\"a e i [o u]\").slow(2)\n * .n(\"<[0,7]!4 [2,7]!4>\")\n * .s('supersquare').osc()\n *\n */", "meta": { "filename": "controls.mjs", - "lineno": 639, + "lineno": 651, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": {} @@ -1151,38 +1151,6 @@ "___id": "T000002R000039", "___s": true }, - { - "comment": "/**\n *\n * Tremolo Audio DSP effect\n *\n * @name tremolodepth\n * @param {number | Pattern} depth between 0 and 1\n * @example\n * n(\"[0,4,7]\").tremolodepth(\"<0 .3 .6 .9>\").osc()\n *\n */", - "meta": { - "filename": "controls.mjs", - "lineno": 672, - "columnno": 2, - "path": "/home/felix/projects/strudel/packages/core", - "code": {} - }, - "description": "Tremolo Audio DSP effect
", - "name": "tremolodepth", - "params": [ - { - "type": { - "names": [ - "number", - "Pattern" - ] - }, - "description": "between 0 and 1
", - "name": "depth" - } - ], - "examples": [ - "n(\"[0,4,7]\").tremolodepth(\"<0 .3 .6 .9>\").osc()" - ], - "longname": "tremolodepth", - "kind": "member", - "scope": "global", - "___id": "T000002R000040", - "___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": { @@ -1252,7 +1220,7 @@ "longname": "drawLine", "kind": "function", "scope": "global", - "___id": "T000002R000047", + "___id": "T000002R000046", "___s": true }, { @@ -1341,7 +1309,7 @@ "longname": "Pattern#euclid", "kind": "function", "scope": "instance", - "___id": "T000002R000071", + "___id": "T000002R000070", "___s": true }, { @@ -1378,7 +1346,7 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000072", + "___id": "T000002R000071", "___s": true }, { @@ -1386,7 +1354,7 @@ "meta": { "range": [ 1178, - 31003 + 31622 ], "filename": "pattern.mjs", "lineno": 17, @@ -1403,7 +1371,7 @@ "kind": "class", "classdesc": "Class representing a pattern.
", "scope": "global", - "description": "Create a pattern.
", + "description": "Create a pattern. As an end user, you will most likely not create a Pattern directly.
", "memberof": "Pattern", "params": [ { @@ -1412,22 +1380,22 @@ "function" ] }, - "description": "The function that maps a State to Haps .
", + "description": "The function that maps a {@link State} to an array of {@link Hap}.
", "name": "query" } ], - "___id": "T000002R000532", + "___id": "T000002R000531", "___s": true }, { "comment": "/**\n * query haps insude the tiven time span\n *\n * @param {Fraction | number} begin from time\n * @param {Fraction | number} end to time\n * @returns Hap[]\n * @example\n * const pattern = sequence('a', ['b', 'c']);\n * const haps = pattern.queryArc(0, 1);\n */", "meta": { "range": [ - 1638, - 1724 + 1737, + 1823 ], "filename": "pattern.mjs", - "lineno": 36, + "lineno": 37, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1479,18 +1447,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000534", + "___id": "T000002R000533", "___s": true }, { "comment": "/**\n * Returns a new pattern, with queries split at cycle boundaries. This makes\n * some calculations easier to express, as all haps are then constrained to\n * happen within a cycle.\n * @returns Pattern\n */", "meta": { "range": [ - 1947, - 2148 + 2046, + 2247 ], "filename": "pattern.mjs", - "lineno": 46, + "lineno": 47, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1515,18 +1483,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000535", + "___id": "T000002R000534", "___s": true }, { "comment": "/**\n * Returns a new pattern, where the given function is applied to the query\n * timespan before passing it to the original pattern.\n * @param {Function} func the function to apply\n * @returns Pattern\n */", "meta": { "range": [ - 2370, - 2464 + 2469, + 2563 ], "filename": "pattern.mjs", - "lineno": 60, + "lineno": 61, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1563,18 +1531,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000538", + "___id": "T000002R000537", "___s": true }, { "comment": "/**\n * As with {@link Pattern#withQuerySpan}, but the function is applied to both the\n * begin and end time of the query timespan.\n * @param {Function} func the function to apply\n * @returns Pattern\n */", "meta": { "range": [ - 2683, - 2802 + 2782, + 2901 ], "filename": "pattern.mjs", - "lineno": 70, + "lineno": 71, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1611,18 +1579,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000539", + "___id": "T000002R000538", "___s": true }, { "comment": "/**\n * Similar to {@link Pattern#withQuerySpan}, but the function is applied to the timespans\n * of all haps returned by pattern queries (both `part` timespans, and where\n * present, `whole` timespans).\n * @param {Function} func\n * @returns Pattern\n */", "meta": { "range": [ - 3073, - 3183 + 3172, + 3282 ], "filename": "pattern.mjs", - "lineno": 81, + "lineno": 82, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1658,18 +1626,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000540", + "___id": "T000002R000539", "___s": true }, { "comment": "/**\n * As with {@link Pattern#withHapSpan}, but the function is applied to both the\n * begin and end time of the hap timespans.\n * @param {Function} func the function to apply\n * @returns Pattern\n */", "meta": { "range": [ - 3399, - 3482 + 3498, + 3581 ], "filename": "pattern.mjs", - "lineno": 91, + "lineno": 92, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1706,18 +1674,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000541", + "___id": "T000002R000540", "___s": true }, { "comment": "/**\n * Returns a new pattern with the given function applied to the list of haps returned by every query.\n * @param {Function} func\n * @returns Pattern\n */", "meta": { "range": [ - 3652, - 3733 + 3751, + 3832 ], "filename": "pattern.mjs", - "lineno": 100, + "lineno": 101, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1753,18 +1721,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000542", + "___id": "T000002R000541", "___s": true }, { "comment": "/**\n * As with {@link Pattern#_withHaps}, but applies the function to every hap, rather than every list of haps.\n * @param {Function} func\n * @returns Pattern\n */", "meta": { "range": [ - 3910, - 3983 + 4009, + 4082 ], "filename": "pattern.mjs", - "lineno": 109, + "lineno": 110, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1800,18 +1768,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000543", + "___id": "T000002R000542", "___s": true }, { "comment": "/**\n * Returns a new pattern with the context field set to every hap set to the given value.\n * @param {*} context\n * @returns Pattern\n */", "meta": { "range": [ - 4136, - 4222 + 4235, + 4321 ], "filename": "pattern.mjs", - "lineno": 118, + "lineno": 119, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1847,18 +1815,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000544", + "___id": "T000002R000543", "___s": true }, { "comment": "/**\n * Returns a new pattern with the given function applied to the context field of every hap.\n * @param {Function} func\n * @returns Pattern\n */", "meta": { "range": [ - 4382, - 4476 + 4481, + 4575 ], "filename": "pattern.mjs", - "lineno": 127, + "lineno": 128, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1894,18 +1862,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000545", + "___id": "T000002R000544", "___s": true }, { "comment": "/**\n * Returns a new pattern with the context field of every hap set to an empty object.\n * @returns Pattern\n */", "meta": { "range": [ - 4601, - 4677 + 4700, + 4776 ], "filename": "pattern.mjs", - "lineno": 135, + "lineno": 136, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1930,18 +1898,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000546", + "___id": "T000002R000545", "___s": true }, { "comment": "/**\n * Returns a new pattern with the given location information added to the\n * context of every hap.\n * @param {Number} start\n * @param {Number} end\n * @returns Pattern\n */", "meta": { "range": [ - 4870, - 5222 + 4969, + 5321 ], "filename": "pattern.mjs", - "lineno": 146, + "lineno": 147, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -1986,18 +1954,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000547", + "___id": "T000002R000546", "___s": true }, { "comment": "/**\n * Returns a new pattern, with the function applied to the value of\n * each hap. It has the alias {@link Pattern#fmap}.\n * @param {Function} func\n * @returns Pattern\n */", "meta": { "range": [ - 6237, - 6346 + 6336, + 6445 ], "filename": "pattern.mjs", - "lineno": 189, + "lineno": 190, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2033,18 +2001,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000581", + "___id": "T000002R000580", "___s": true }, { "comment": "/**\n * see {@link Pattern#withValue}\n */", "meta": { "range": [ - 6397, - 6446 + 6496, + 6545 ], "filename": "pattern.mjs", - "lineno": 196, + "lineno": 197, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2066,18 +2034,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000582", + "___id": "T000002R000581", "___s": true }, { "comment": "/**\n * Returns a new Pattern, which only returns haps that meet the given test.\n * @param {Function} hap_test - a function which returns false for haps to be removed from the pattern\n * @returns Pattern\n */", "meta": { "range": [ - 6667, - 6765 + 6766, + 6864 ], "filename": "pattern.mjs", - "lineno": 205, + "lineno": 206, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2114,18 +2082,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000583", + "___id": "T000002R000582", "___s": true }, { "comment": "/**\n * As with {@link Pattern#_filterHaps}, but the function is applied to values\n * inside haps.\n * @param {Function} value_test\n * @returns Pattern\n */", "meta": { "range": [ - 6935, - 7059 + 7034, + 7158 ], "filename": "pattern.mjs", - "lineno": 215, + "lineno": 216, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2161,18 +2129,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000584", + "___id": "T000002R000583", "___s": true }, { "comment": "/**\n * Returns a new pattern, with haps containing undefined values removed from\n * query results.\n * @returns Pattern\n */", "meta": { "range": [ - 7196, - 7279 + 7295, + 7378 ], "filename": "pattern.mjs", - "lineno": 224, + "lineno": 225, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2197,18 +2165,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000585", + "___id": "T000002R000584", "___s": true }, { "comment": "/**\n * Returns a new pattern, with all haps without onsets filtered out. A hap\n * with an onset is one with a `whole` timespan that begins at the same time\n * as its `part` timespan.\n * @returns Pattern\n */", "meta": { "range": [ - 7502, - 7768 + 7601, + 7867 ], "filename": "pattern.mjs", - "lineno": 234, + "lineno": 235, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2233,18 +2201,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000586", + "___id": "T000002R000585", "___s": true }, { "comment": "/**\n * Returns a new pattern, with 'continuous' haps (those without 'whole'\n * timespans) removed from query results.\n * @returns Pattern\n */", "meta": { "range": [ - 7924, - 8059 + 8023, + 8158 ], "filename": "pattern.mjs", - "lineno": 246, + "lineno": 247, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2269,18 +2237,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000587", + "___id": "T000002R000586", "___s": true }, { "comment": "/**\n * When this method is called on a pattern of functions, it matches its haps\n * with those in the given pattern of values. A new pattern is returned, with\n * each matching value applied to the corresponding function.\n *\n * In this `appBoth` variant, where timespans of the function and value haps\n * are not the same but do intersect, the resulting hap has a timespan of the\n * intersection. This applies to both the part and the whole timespan.\n * @param {Pattern} pat_val\n * @returns Pattern\n */", "meta": { "range": [ - 9502, - 9783 + 9601, + 9882 ], "filename": "pattern.mjs", - "lineno": 289, + "lineno": 290, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2316,18 +2284,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000595", + "___id": "T000002R000594", "___s": true }, { "comment": "/**\n * As with {@link Pattern#appBoth}, but the `whole` timespan is not the intersection,\n * but the timespan from the function of patterns that this method is called\n * on. In practice, this means that the pattern structure, including onsets,\n * are preserved from the pattern of functions (often referred to as the left\n * hand or inner pattern).\n * @param {Pattern} pat_val\n * @returns Pattern\n */", "meta": { "range": [ - 10206, - 10950 + 10305, + 11049 ], "filename": "pattern.mjs", - "lineno": 309, + "lineno": 310, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2363,18 +2331,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000597", + "___id": "T000002R000596", "___s": true }, { "comment": "/**\n * As with {@link Pattern#appLeft}, but `whole` timespans are instead taken from the\n * pattern of values, i.e. structure is preserved from the right hand/outer\n * pattern.\n * @param {Pattern} pat_val\n * @returns Pattern\n */", "meta": { "range": [ - 11197, - 11942 + 11296, + 12041 ], "filename": "pattern.mjs", - "lineno": 339, + "lineno": 340, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2410,18 +2378,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000609", + "___id": "T000002R000608", "___s": true }, { "comment": "/**\n * Queries the pattern for the first cycle, returning Haps. Mainly of use when\n * debugging a pattern.\n * @param {Boolean} with_context - set to true, otherwise the context field\n * will be stripped from the resulting haps.\n * @returns [Hap]\n */", "meta": { "range": [ - 12210, - 12409 + 12309, + 12508 ], "filename": "pattern.mjs", - "lineno": 369, + "lineno": 370, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2459,18 +2427,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000621", + "___id": "T000002R000620", "___s": true }, { "comment": "/**\n * Accessor for a list of values returned by querying the first cycle.\n */", "meta": { "range": [ - 12498, - 12581 + 12597, + 12680 ], "filename": "pattern.mjs", - "lineno": 380, + "lineno": 381, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2490,18 +2458,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000624", + "___id": "T000002R000623", "___s": true }, { "comment": "/**\n * More human-readable version of the {@link Pattern#_firstCycleValues} accessor.\n */", "meta": { "range": [ - 12681, - 12845 + 12780, + 12944 ], "filename": "pattern.mjs", - "lineno": 387, + "lineno": 388, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2521,18 +2489,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000625", + "___id": "T000002R000624", "___s": true }, { "comment": "/**\n * Returns a new pattern, which returns haps sorted in temporal order. Mainly\n * of use when comparing two patterns for equality, in tests.\n * @returns Pattern\n */", "meta": { "range": [ - 13027, - 13302 + 13126, + 13401 ], "filename": "pattern.mjs", - "lineno": 398, + "lineno": 399, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2557,18 +2525,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000626", + "___id": "T000002R000625", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern. Returns a new pattern with all values rounded\n * to the nearest integer.\n * @returns Pattern\n */", "meta": { "range": [ - 15210, - 15279 + 15309, + 15378 ], "filename": "pattern.mjs", - "lineno": 471, + "lineno": 472, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2593,18 +2561,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000645", + "___id": "T000002R000644", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern. Returns a new pattern with all values set to\n * their mathematical floor. E.g. `3.7` replaced with to `3`, and `-4.2`\n * replaced with `-5`.\n * @returns Pattern\n */", "meta": { "range": [ - 15496, - 15565 + 15595, + 15664 ], "filename": "pattern.mjs", - "lineno": 481, + "lineno": 482, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2629,18 +2597,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000646", + "___id": "T000002R000645", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern. Returns a new pattern with all values set to\n * their mathematical ceiling. E.g. `3.2` replaced with `4`, and `-4.2`\n * replaced with `-4`.\n * @returns Pattern\n */", "meta": { "range": [ - 15781, - 15848 + 15880, + 15947 ], "filename": "pattern.mjs", - "lineno": 491, + "lineno": 492, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2665,18 +2633,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000647", + "___id": "T000002R000646", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern, containing unipolar values in the range 0 ..\n * 1. Returns a new pattern with values scaled to the bipolar range -1 .. 1\n * @returns Pattern\n */", "meta": { "range": [ - 16043, - 16101 + 16142, + 16200 ], "filename": "pattern.mjs", - "lineno": 500, + "lineno": 501, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2701,18 +2669,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000648", + "___id": "T000002R000647", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern, containing bipolar values in the range -1 ..\n * 1. Returns a new pattern with values scaled to the unipolar range 0 .. 1\n * @returns Pattern\n */", "meta": { "range": [ - 16296, - 16358 + 16395, + 16457 ], "filename": "pattern.mjs", - "lineno": 509, + "lineno": 510, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2737,18 +2705,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000649", + "___id": "T000002R000648", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern, containing unipolar values in the range 0 ..\n * 1. Returns a new pattern with values scaled to the given min/max range.\n * @param {Number} min\n * @param {Number} max\n * @returns Pattern\n */", "meta": { "range": [ - 16602, - 16664 + 16701, + 16763 ], "filename": "pattern.mjs", - "lineno": 520, + "lineno": 521, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2793,18 +2761,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000650", + "___id": "T000002R000649", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern, containing unipolar values in the range 0 ..\n * 1. Returns a new pattern with values scaled to the given min/max range,\n * following an exponential curve.\n * @param {Number} min\n * @param {Number} max\n * @returns Pattern\n */", "meta": { "range": [ - 16945, - 17035 + 17044, + 17134 ], "filename": "pattern.mjs", - "lineno": 532, + "lineno": 533, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2849,18 +2817,18 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000651", + "___id": "T000002R000650", "___s": true }, { "comment": "/**\n * Assumes a numerical pattern, containing bipolar values in the range -1 ..\n * 1. Returns a new pattern with values scaled to the given min/max range.\n * @param {Number} min\n * @param {Number} max\n * @returns Pattern\n */", "meta": { "range": [ - 17279, - 17349 + 17378, + 17448 ], "filename": "pattern.mjs", - "lineno": 543, + "lineno": 544, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2905,18 +2873,94 @@ "kind": "function", "memberof": "Pattern", "scope": "instance", - "___id": "T000002R000652", + "___id": "T000002R000651", + "___s": true + }, + { + "comment": "/**\n * Speed up a pattern by the given factor.\n *\n * @name fast\n * @memberof Pattern\n * @param {number | Pattern} factor speed up factor\n * @returns Pattern\n * @example\n * seq(e5, b4, d5, c5).fast(2)\n */", + "meta": { + "filename": "pattern.mjs", + "lineno": 735, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "Speed up a pattern by the given factor.
", + "name": "fast", + "memberof": "Pattern", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "speed up factor
", + "name": "factor" + } + ], + "returns": [ + { + "description": "Pattern
" + } + ], + "examples": [ + "seq(e5, b4, d5, c5).fast(2)" + ], + "scope": "static", + "longname": "Pattern.fast", + "kind": "member", + "___id": "T000002R000700", + "___s": true + }, + { + "comment": "/**\n * Slow down a pattern over the given number of cycles.\n *\n * @name slow\n * @memberof Pattern\n * @param {number | Pattern} factor slow down factor\n * @returns Pattern\n * @example\n * seq(e5, b4, d5, c5).slow(2)\n */", + "meta": { + "filename": "pattern.mjs", + "lineno": 750, + "columnno": 2, + "path": "/home/felix/projects/strudel/packages/core", + "code": {} + }, + "description": "Slow down a pattern over the given number of cycles.
", + "name": "slow", + "memberof": "Pattern", + "params": [ + { + "type": { + "names": [ + "number", + "Pattern" + ] + }, + "description": "slow down factor
", + "name": "factor" + } + ], + "returns": [ + { + "description": "Pattern
" + } + ], + "examples": [ + "seq(e5, b4, d5, c5).slow(2)" + ], + "scope": "static", + "longname": "Pattern.slow", + "kind": "member", + "___id": "T000002R000703", "___s": true }, { "comment": "/**\n * Returns a new pattern where every other cycle is played once, twice as\n * fast, and offset in time by one quarter of a cycle. Creates a kind of\n * breakbeat feel.\n * @returns Pattern\n */", "meta": { "range": [ - 27227, - 27323 + 27788, + 27884 ], "filename": "pattern.mjs", - "lineno": 883, + "lineno": 904, "columnno": 2, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2941,18 +2985,18 @@ "memberof": "Pattern", "scope": "instance", "params": [], - "___id": "T000002R000749", + "___id": "T000002R000750", "___s": true }, { "comment": "/** A discrete value that repeats once per cycle:\n *\n * @param {any} value - The value to repeat\n * @returns {Pattern}\n * @example\n * pure('e4')\n */", "meta": { "range": [ - 35084, - 35288 + 35703, + 35907 ], "filename": "pattern.mjs", - "lineno": 1181, + "lineno": 1203, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -2992,18 +3036,18 @@ "longname": "pure", "kind": "function", "scope": "global", - "___id": "T000002R000867", + "___id": "T000002R000868", "___s": true }, { "comment": "/** The given items are played at the same time at the same length:\n *\n * @param {...any} items - The items to stack\n * @return {Pattern}\n * @example\n * stack(g3, b3, [e4, d4])\n */", "meta": { "range": [ - 35801, - 36074 + 36420, + 36693 ], "filename": "pattern.mjs", - "lineno": 1208, + "lineno": 1230, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3044,18 +3088,18 @@ "longname": "stack", "kind": "function", "scope": "global", - "___id": "T000002R000874", + "___id": "T000002R000875", "___s": true }, { "comment": "/** Concatenation: combines a list of patterns, switching between them successively, one per cycle:\n *\n * synonyms: {@link cat}\n *\n * @param {...any} items - The items to concatenate\n * @return {Pattern}\n * @example\n * slowcat(e5, b4, [d5, c5])\n *\n */", "meta": { "range": [ - 36328, - 37239 + 36947, + 37858 ], "filename": "pattern.mjs", - "lineno": 1225, + "lineno": 1247, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3096,18 +3140,18 @@ "longname": "slowcat", "kind": "function", "scope": "global", - "___id": "T000002R000878", + "___id": "T000002R000879", "___s": true }, { "comment": "/** Concatenation: combines a list of patterns, switching between them successively, one per cycle. Unlike slowcat, this version will skip cycles.\n * @param {...any} items - The items to concatenate\n * @return {Pattern}\n */", "meta": { "range": [ - 37465, - 37737 + 38084, + 38356 ], "filename": "pattern.mjs", - "lineno": 1250, + "lineno": 1272, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3145,18 +3189,18 @@ "longname": "slowcatPrime", "kind": "function", "scope": "global", - "___id": "T000002R000886", + "___id": "T000002R000887", "___s": true }, { - "comment": "/** Concatenation: as with {@link slowcat}, but squashes a cycle from each pattern into one cycle\n *\n * Synonyms: {@link seq}, {@link sequence}\n *\n * @param {...any} items - The items to concatenate\n * @return {Pattern}\n * @example\n * fastcat(e5, b4, [d5, c5])\n * sequence(e5, b4, [d5, c5])\n * seq(e5, b4, [d5, c5])\n */", + "comment": "/** Concatenation: as with {@link slowcat}, but squashes a cycle from each pattern into one cycle\n *\n * Synonyms: {@link seq}, {@link sequence}\n *\n * @param {...any} items - The items to concatenate\n * @return {Pattern}\n * @example\n * fastcat(e5, b4, [d5, c5])\n * // sequence(e5, b4, [d5, c5])\n * // seq(e5, b4, [d5, c5])\n */", "meta": { "range": [ - 38059, - 38141 + 38684, + 38766 ], "filename": "pattern.mjs", - "lineno": 1271, + "lineno": 1293, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3191,24 +3235,24 @@ } ], "examples": [ - "fastcat(e5, b4, [d5, c5])\nsequence(e5, b4, [d5, c5])\nseq(e5, b4, [d5, c5])" + "fastcat(e5, b4, [d5, c5])\n// sequence(e5, b4, [d5, c5])\n// seq(e5, b4, [d5, c5])" ], "name": "fastcat", "longname": "fastcat", "kind": "function", "scope": "global", - "___id": "T000002R000892", + "___id": "T000002R000893", "___s": true }, { "comment": "/** See {@link slowcat} */", "meta": { "range": [ - 38170, - 38229 + 38795, + 38854 ], "filename": "pattern.mjs", - "lineno": 1276, + "lineno": 1298, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3225,18 +3269,18 @@ "longname": "cat", "kind": "function", "scope": "global", - "___id": "T000002R000894", + "___id": "T000002R000895", "___s": true }, { "comment": "/** Like {@link fastcat}, but where each step has a temporal weight:\n * @param {...Array} items - The items to concatenate\n * @return {Pattern}\n * @example\n * timeCat([3,e3],[1, g3])\n */", "meta": { "range": [ - 38418, - 38777 + 39043, + 39402 ], "filename": "pattern.mjs", - "lineno": 1286, + "lineno": 1308, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3277,18 +3321,18 @@ "longname": "timeCat", "kind": "function", "scope": "global", - "___id": "T000002R000896", + "___id": "T000002R000897", "___s": true }, { "comment": "/** See {@link fastcat} */", "meta": { "range": [ - 38806, - 38870 + 39431, + 39495 ], "filename": "pattern.mjs", - "lineno": 1299, + "lineno": 1321, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3305,18 +3349,18 @@ "longname": "sequence", "kind": "function", "scope": "global", - "___id": "T000002R000903", + "___id": "T000002R000904", "___s": true }, { "comment": "/** See {@link fastcat} */", "meta": { "range": [ - 38899, - 38958 + 39524, + 39583 ], "filename": "pattern.mjs", - "lineno": 1304, + "lineno": 1326, "columnno": 0, "path": "/home/felix/projects/strudel/packages/core", "code": { @@ -3333,7 +3377,7 @@ "longname": "seq", "kind": "function", "scope": "global", - "___id": "T000002R000905", + "___id": "T000002R000906", "___s": true }, { @@ -3372,7 +3416,7 @@ "scope": "static", "longname": "Pattern.transpose", "kind": "member", - "___id": "T000002R003714", + "___id": "T000002R003715", "___s": true }, { @@ -3409,7 +3453,7 @@ "scope": "static", "longname": "Pattern.scaleTranspose", "kind": "member", - "___id": "T000002R003718", + "___id": "T000002R003719", "___s": true }, { @@ -3446,7 +3490,7 @@ "scope": "static", "longname": "Pattern.scale", "kind": "member", - "___id": "T000002R003720", + "___id": "T000002R003721", "___s": true }, { @@ -3483,7 +3527,7 @@ "scope": "static", "longname": "Pattern.voicings", "kind": "member", - "___id": "T000002R003745", + "___id": "T000002R003746", "___s": true }, { @@ -3565,7 +3609,7 @@ "/home/felix/projects/strudel/packages/xen/tunejs.js", "/home/felix/projects/strudel/packages/xen/xen.mjs" ], - "___id": "T000002R014014", + "___id": "T000002R014015", "___s": true } ] diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 0ee73875..f6afb7df 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -16,8 +16,9 @@ import drawLine from './drawLine.mjs'; /** @class Class representing a pattern. */ export class Pattern { /** - * Create a pattern. - * @param {function} query - The function that maps a State to Haps . + * Create a pattern. As an end user, you will most likely not create a Pattern directly. + * + * @param {function} query - The function that maps a {@link State} to an array of {@link Hap}. */ constructor(query) { this.query = query; @@ -731,11 +732,31 @@ export class Pattern { return this._compress(span.begin, span.end); } + /** + * Speed up a pattern by the given factor. + * + * @name fast + * @memberof Pattern + * @param {number | Pattern} factor speed up factor + * @returns Pattern + * @example + * seq(e5, b4, d5, c5).fast(2) + */ _fast(factor) { const fastQuery = this.withQueryTime((t) => t.mul(factor)); return fastQuery.withHapTime((t) => t.div(factor)); } + /** + * Slow down a pattern over the given number of cycles. + * + * @name slow + * @memberof Pattern + * @param {number | Pattern} factor slow down factor + * @returns Pattern + * @example + * seq(e5, b4, d5, c5).slow(2) + */ _slow(factor) { return this._fast(Fraction(1).div(factor)); } @@ -1022,6 +1043,7 @@ export class Pattern { return this._withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity })); } + // move this to controls? (speed and unit are controls) _loopAt(factor, cps = 1) { return this.speed((1 / factor) * cps) .unit('c') @@ -1265,8 +1287,8 @@ export function slowcatPrime(...pats) { * @return {Pattern} * @example * fastcat(e5, b4, [d5, c5]) - * sequence(e5, b4, [d5, c5]) - * seq(e5, b4, [d5, c5]) + * // sequence(e5, b4, [d5, c5]) + * // seq(e5, b4, [d5, c5]) */ export function fastcat(...pats) { return slowcat(...pats)._fast(pats.length); diff --git a/tutorial/ApiDoc.jsx b/tutorial/ApiDoc.jsx index fa752818..ef9a35fb 100644 --- a/tutorial/ApiDoc.jsx +++ b/tutorial/ApiDoc.jsx @@ -8,7 +8,8 @@ function ApiDoc() { if (!visible) { return (- The API Docs are a work in progress, but you can preview it by clicking here + There remaining function documentation is a work in progress, but you can preview it by clicking{' '} + here. Beware that everything is not properly ordered from this point.
); } @@ -16,8 +17,8 @@ function ApiDoc() { return (- The following Chapter is the technical API documentation. It is autogenerated from the jsdoc comments in the - source files. hide + The following Chapter is autogenerated from the jsdoc comments in the source files.{' '} + hide. Beware that everything is not properly ordered from this point.
{docs .filter((item) => !item.name?.startsWith('_') && item.kind !== 'package') diff --git a/tutorial/Tutorial.jsx b/tutorial/Tutorial.jsx index 2e77a327..d6ef86ab 100644 --- a/tutorial/Tutorial.jsx +++ b/tutorial/Tutorial.jsx @@ -7,6 +7,8 @@ This program is free software: you can redistribute it and/or modify it under th import React from 'react'; import ReactDOM from 'react-dom'; import Tutorial from './tutorial.mdx'; +import ApiDoc from './ApiDoc' +import Api from './api.mdx'; import './style.scss'; import '@strudel.cycles/react/dist/style.css'; @@ -30,6 +32,8 @@ ReactDOM.render(A discrete value that repeats once per cycle:
+ +**Parameters** + +- value (any): The value to repeat + +**Examples** + +Concatenation: combines a list of patterns, switching between them successively, one per cycle:
+synonyms: cat
+ +**Parameters** + +- items (any): The items to concatenate + +**Examples** + +Concatenation: as with slowcat, but squashes a cycle from each pattern into one cycle
+ + +**Parameters** + +- items (any): The items to concatenate + +**Examples** + +The given items are played at the same time at the same length:
+ +**Parameters** + +- items (any): The items to stack + +**Examples** + +Like fastcat, but where each step has a temporal weight:
+ +**Parameters** + +- items (Array): The items to concatenate + +**Examples** + +Slow down a pattern over the given number of cycles.
+ +**Parameters** + +- factor (number|Pattern): slow down factor + +**Examples** + +Speed up a pattern by the given factor.
+ +**Parameters** + +- factor (number|Pattern): speed up factor + +**Examples** + +