One more example

This commit is contained in:
Aria
2025-10-11 01:28:31 -05:00
parent 32d11d0332
commit 1162a42218
2 changed files with 23 additions and 3 deletions
+8 -3
View File
@@ -3535,7 +3535,7 @@ export const morph = (frompat, topat, bypat) => {
return frompat.innerBind((from) => topat.innerBind((to) => bypat.innerBind((by) => _morph(from, to, by))));
};
const TIMELINES = {
export const TIMELINES = {
currentOffsets: {},
previousOffsets: {},
};
@@ -3554,10 +3554,15 @@ const TIMELINES = {
* @example
* s("tri").seg(8).n(irand(12)).scale("G#:minor").lpf(400).room(2)
* .timeline("<1 -1 1 2>")
* @example
* $: n("[0 .. 6]/4").scale("F:minor")
* // Execute the following line at any point in the session
* // and it will always start on note 0
* // $: n("[0 .. 6]/4").scale("F:minor").timeline(2)
*/
const timeline = register('timeline', (id, pat) => {
// TODO: This is only included to demonstrate the possible options. We should pick one
// before merging
// TODO: This hard-coding of `behavior` and the switch below are only included to demonstrate
// the possible reset options. We should pick one before merging
const behavior = 0;
if (typeof id !== 'number') {
logger(`[query] ${id} is not a valid timeline id. Please ensure it is a number. Defaulting to timeline 1.`);
+15
View File
@@ -10846,6 +10846,21 @@ exports[`runs examples > example "take" example index 2 1`] = `
exports[`runs examples > example "timeline" example index 0 1`] = `[]`;
exports[`runs examples > example "timeline" example index 1 1`] = `
[
"[ 0/1 → 4/7 | note:F3 ]",
"[ (4/7 → 1/1) ⇝ 8/7 | note:G3 ]",
"[ 4/7 ⇜ (1/1 → 8/7) | note:G3 ]",
"[ 8/7 → 12/7 | note:Ab3 ]",
"[ (12/7 → 2/1) ⇝ 16/7 | note:Bb3 ]",
"[ 12/7 ⇜ (2/1 → 16/7) | note:Bb3 ]",
"[ 16/7 → 20/7 | note:C4 ]",
"[ (20/7 → 3/1) ⇝ 24/7 | note:Db4 ]",
"[ 20/7 ⇜ (3/1 → 24/7) | note:Db4 ]",
"[ 24/7 → 4/1 | note:Eb4 ]",
]
`;
exports[`runs examples > example "tour" example index 0 1`] = `
[
"[ 0/1 → 1/8 | note:e s:folkharp ]",