Merge pull request #98 from tidalcycles/paper

Paper
This commit is contained in:
Alex McLean 2022-04-25 23:13:07 +01:00 committed by GitHub
commit 3b38d936a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 1798 additions and 45 deletions

View File

@ -23,6 +23,8 @@ const isNote = (name) => /^[a-gC-G][bs]?[0-9]$/.test(name);
const addLocations = true;
export const addMiniLocations = true;
export const minifyStrings = true;
export const wrappedAsync = true;
export default (_code) => {
const { code, addReturn } = wrapAsync(_code);
@ -38,18 +40,18 @@ export default (_code) => {
}
// replace template string `xxx` with mini(`xxx`)
if (isBackTickString(node)) {
if (minifyStrings && isBackTickString(node)) {
return minifyWithLocation(node, node, ast.locations, artificialNodes);
}
// allows to use top level strings, which are normally directives... but we don't need directives
if (node.directives?.length === 1 && !node.statements?.length) {
if (minifyStrings && node.directives?.length === 1 && !node.statements?.length) {
const str = new LiteralStringExpression({ value: node.directives[0].rawValue });
const wrapped = minifyWithLocation(str, node.directives[0], ast.locations, artificialNodes);
return { ...node, directives: [], statements: [wrapped] };
}
// replace double quote string "xxx" with mini('xxx')
if (isStringWithDoubleQuotes(node, ast.locations, code)) {
if (minifyStrings && isStringWithDoubleQuotes(node, ast.locations, code)) {
return minifyWithLocation(node, node, ast.locations, artificialNodes);
}
@ -117,7 +119,9 @@ export default (_code) => {
},
});
// add return to last statement (because it's wrapped in an async function artificially)
addReturn(shifted);
if (wrappedAsync) {
addReturn(shifted);
}
const generated = codegen(shifted);
return generated;
};
@ -125,9 +129,11 @@ export default (_code) => {
function wrapAsync(code) {
// wrap code in async to make await work on top level => this will create 1 line offset to locations
// this is why line offset is -1 in getLocationObject calls below
code = `(async () => {
if (wrappedAsync) {
code = `(async () => {
${code}
})()`;
}
const addReturn = (ast) => {
const body = ast.statements[0].expression.callee.body; // actual code ast inside async function body
body.statements = body.statements
@ -204,9 +210,10 @@ function hasModifierCall(parent) {
parent?.type === 'StaticMemberExpression' && Object.keys(Pattern.prototype.composable).includes(parent.property)
);
}
const factories = Object.keys(Pattern.prototype.factories).concat(['mini']);
function isPatternFactory(node) {
return node?.type === 'CallExpression' && Object.keys(Pattern.prototype.factories).includes(node.callee.name);
return node?.type === 'CallExpression' && factories.includes(node.callee.name);
}
function canBeOverloaded(node) {
@ -233,9 +240,14 @@ function reifyWithLocation(literalNode, node, locations, artificialNodes) {
// with this, the reified pattern can pass its location to the event, to know where to highlight when it's active
function minifyWithLocation(literalNode, node, locations, artificialNodes) {
const args = getLocationArguments(node, locations);
const wrapped = wrapFunction('mini', literalNode);
if (!addMiniLocations) {
artificialNodes.push(wrapped);
return wrapped;
}
const withLocation = new CallExpression({
callee: new StaticMemberExpression({
object: wrapFunction('mini', literalNode),
object: wrapped,
property: 'withMiniLocation',
}),
arguments: args,
@ -246,17 +258,18 @@ function minifyWithLocation(literalNode, node, locations, artificialNodes) {
function getLocationArguments(node, locations) {
const loc = locations.get(node);
const lineOffset = wrappedAsync ? -1 : 0;
return [
new ArrayExpression({
elements: [
new LiteralNumericExpression({ value: loc.start.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.start.line + lineOffset }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.start.column }),
new LiteralNumericExpression({ value: loc.start.offset }),
],
}),
new ArrayExpression({
elements: [
new LiteralNumericExpression({ value: loc.end.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.end.line + lineOffset }), // the minus 1 assumes the code has been wrapped in async iife
new LiteralNumericExpression({ value: loc.end.column }),
new LiteralNumericExpression({ value: loc.end.offset }),
],

View File

@ -104,6 +104,533 @@
"title": "Alternate Timelines for TidalCycles",
"type": ""
}
},
"https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42": {
"fetched": "2022-04-12T22:47:17.063Z",
"bibtex": [
"",
"@misc{roberts_bringing_2019,",
" title = {Bringing the {TidalCycles} {Mini}-{Notation} to the {Browser}},",
" url = {https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42},",
" abstract = {A JavaScript dialect of its mini-notation for pattern is created, enabling easy integration with creative coding tools and an accompanying technique for visually annotating the playback of TidalCycles patterns over time. TidalCycles has rapidly become the most popular system for many styles of live coding performance, in particular Algoraves. We created a JavaScript dialect of its mini-notation for pattern, enabling easy integration with creative coding tools. Our research pairs a formalism describing the mini-notation with a small JavaScript library for generating events over time; this library is suitable for generating events inside of an AudioWorkletProcessor thread and for assisting with scheduling in JavaScript environments more generally. We describe integrating the library into the two live coding systems, Gibber and Hydra, and discuss an accompanying technique for visually annotating the playback of TidalCycles patterns over time.},",
" language = {en},",
" urldate = {2022-04-12},",
" journal = {www.semanticscholar.org},",
" author = {Roberts, Charles},",
" year = {2019},",
"}",
""
],
"csl": {
"URL": "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42",
"abstract": "A JavaScript dialect of its mini-notation for pattern is created, enabling easy integration with creative coding tools and an accompanying technique for visually annotating the playback of TidalCycles patterns over time. TidalCycles has rapidly become the most popular system for many styles of live coding performance, in particular Algoraves. We created a JavaScript dialect of its mini-notation for pattern, enabling easy integration with creative coding tools. Our research pairs a formalism describing the mini-notation with a small JavaScript library for generating events over time; this library is suitable for generating events inside of an AudioWorkletProcessor thread and for assisting with scheduling in JavaScript environments more generally. We describe integrating the library into the two live coding systems, Gibber and Hydra, and discuss an accompanying technique for visually annotating the playback of TidalCycles patterns over time.",
"accessed": {
"date-parts": [
[
2022,
4,
12
]
]
},
"author": [
{
"family": "Roberts",
"given": "Charles"
}
],
"container-title": "www.semanticscholar.org",
"id": "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42",
"issued": {
"date-parts": [
[
2019
]
]
},
"title": "Bringing the TidalCycles Mini-Notation to the Browser",
"type": ""
}
},
"https://zenodo.org/record/6456380": {
"fetched": "2022-04-14T21:26:21.302Z",
"bibtex": [
"",
"@misc{mclean_tidalvortex_2022,",
" address = {Limerick, Ireland},",
" title = {{TidalVortex} {Zero}},",
" url = {https://zenodo.org/record/6456380},",
" abstract = {In this paper we introduce version zero of TidalVortex, an alternative implementation of the TidalCycles live coding system, using the Python programming language.  This is open-ended work, exploring what happens when we try to extract the 'essence' of a system like TidalCycles and translate it into another programming language, while taking advantage of the affordance of its new host. First, we review the substantial prior art in porting TidalCycles, and in representing musical patterns in Python. We then compare equivalent patterns written in Haskell (TidalCycles) and Python (TidalVortex), and relate implementation details of how functional reactive paradigms have translated from the pure functional, strongly typed Haskell to the more multi-paradigm, dynamically typed Python. Finally, we conclude with reflections and generalisable outcomes.},",
" urldate = {2022-04-14},",
" collaborator = {McLean, Alex and Forment, Raphaël and Le Beux, Sylvain and Silvani, Damián},",
" month = apr,",
" year = {2022},",
"}",
""
],
"csl": {
"URL": "https://zenodo.org/record/6456380",
"abstract": "In this paper we introduce “version zero” of TidalVortex, an alternative implementation of the TidalCycles live coding system, using the Python programming language.  This is open-ended work, exploring what happens when we try to extract the essence of a system like TidalCycles and translate it into another programming language, while taking advantage of the affordance of its new host. First, we review the substantial prior art in porting TidalCycles, and in representing musical patterns in Python. We then compare equivalent patterns written in Haskell (TidalCycles) and Python (TidalVortex), and relate implementation details of how functional reactive paradigms have translated from the pure functional, strongly typed Haskell to the more multi-paradigm, dynamically typed Python. Finally, we conclude with reflections and generalisable outcomes.",
"accessed": {
"date-parts": [
[
2022,
4,
14
]
]
},
"id": "https://zenodo.org/record/6456380",
"issued": {
"date-parts": [
[
2022,
4
]
]
},
"publisher-place": "Limerick, Ireland",
"title": "TidalVortex Zero",
"type": ""
}
},
"https://zenodo.org/record/4299661": {
"fetched": "2022-04-15T07:40:08.702Z",
"bibtex": [
"",
"@misc{mclean_algorithmic_2020,",
" address = {Birmingham UK},",
" title = {Algorithmic {Pattern}},",
" url = {https://zenodo.org/record/4299661},",
" abstract = {This paper brings together two main perspectives on algorithmic pattern. First, the writing of musical patterns in live coding performance, and second, the weaving of patterns in textiles. In both cases, algorithmic pattern is an interface between the human and the outcome, where small changes have far-reaching impact on the results. By bringing contemporary live coding and ancient textile approaches together, we reach a common view of pattern as algorithmic movement (e.g. looping, shifting, reflecting, interfering) in the making of things. This works beyond the usual definition of pattern used in musical interfaces, of mere repeating sequences. We conclude by considering the place of algorithmic pattern in a wider activity of making.},",
" urldate = {2022-04-15},",
" collaborator = {McLean, Alex},",
" month = jul,",
" year = {2020},",
" keywords = {pattern, tidalcycles, algorithmic music, textiles, live coding, algorave},",
"}",
""
],
"csl": {
"URL": "https://zenodo.org/record/4299661",
"abstract": "This paper brings together two main perspectives on algorithmic pattern. First, the writing of musical patterns in live coding performance, and second, the weaving of patterns in textiles. In both cases, algorithmic pattern is an interface between the human and the outcome, where small changes have far-reaching impact on the results. By bringing contemporary live coding and ancient textile approaches together, we reach a common view of pattern as algorithmic movement (e.g. looping, shifting, reflecting, interfering) in the making of things. This works beyond the usual definition of pattern used in musical interfaces, of mere repeating sequences. We conclude by considering the place of algorithmic pattern in a wider activity of making.",
"accessed": {
"date-parts": [
[
2022,
4,
15
]
]
},
"id": "https://zenodo.org/record/4299661",
"issued": {
"date-parts": [
[
2020,
7
]
]
},
"keyword": "pattern, tidalcycles, algorithmic music, textiles, live coding, algorave",
"publisher-place": "Birmingham UK",
"title": "Algorithmic Pattern",
"type": ""
}
},
"https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/gibber-live-coding-audio-in-the-browser?page=root;size=150;view=text": {
"fetched": "2022-04-15T07:40:15.037Z",
"bibtex": [
"",
"@article{charlie_gibber:_2012,",
" title = {{GIBBER}: {LIVE} {CODING} {AUDIO} {IN} {THE} {BROWSER}},",
" volume = {2012},",
" issn = {2223-3881},",
" url = {https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/%E2%80%93gibber-live-coding-audio-in-the-browser?page=root;size=150;view=text},",
" language = {en},",
" urldate = {2022-04-15},",
" journal = {International Computer Music Conference Proceedings},",
" author = {Charlie, , Roberts and Joann, , Kuchera-Morin},",
" year = {2012},",
"}",
""
],
"csl": {
"ISSN": "2223-3881",
"URL": "https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/%E2%80%93gibber-live-coding-audio-in-the-browser?page=root;size=150;view=text",
"accessed": {
"date-parts": [
[
2022,
4,
15
]
]
},
"author": [
{
"family": "Charlie",
"given": "Roberts"
},
{
"family": "Joann",
"given": "Kuchera-Morin"
}
],
"container-title": "International Computer Music Conference Proceedings",
"id": "https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/gibber-live-coding-audio-in-the-browser?page_x61_root;size_x61_150;view_x61_text",
"issued": {
"date-parts": [
[
2012
]
]
},
"title": "GIBBER: LIVE CODING AUDIO IN THE BROWSER",
"title-short": "GIBBER",
"type": "article-journal",
"volume": "2012"
}
},
"https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b": {
"fetched": "2022-04-15T07:40:17.179Z",
"bibtex": [
"",
"@misc{ogborn_estuary:_2017,",
" title = {Estuary: {Browser}-based {Collaborative} {Projectional} {Live} {Coding} of {Musical} {Patterns}},",
" shorttitle = {Estuary},",
" url = {https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b},",
" abstract = {Estuary is a browser-based collaborative projectional editing environment built on top of the popular TidalCycles language for the live coding of musical pattern that includes a strict form of structure editing, a click-only border-free approach to interface design, and explicit notations to modulate the liveness of different parts of the code. This paper describes the initial design and development of Estuary, a browser-based collaborative projectional editing environment built on top of the popular TidalCycles language for the live coding of musical pattern. Key features of Estuary include a strict form of structure editing (making syntactical errors impossible), a click-only border-free approach to interface design, explicit notations to modulate the liveness of different parts of the code, and a server-based network collaboration system that can be used for many simultaneous collaborative live coding performances, as well as to present different views of the same live coding activity. Estuary has been developed using Reflex-DOM, a Haskell-based framework for web development whose strictness promises robustness and security advantages.},",
" language = {en},",
" urldate = {2022-04-15},",
" journal = {www.semanticscholar.org},",
" author = {Ogborn, David and Beverley, J.},",
" year = {2017},",
"}",
""
],
"csl": {
"URL": "https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b",
"abstract": "Estuary is a browser-based collaborative projectional editing environment built on top of the popular TidalCycles language for the live coding of musical pattern that includes a strict form of structure editing, a click-only border-free approach to interface design, and explicit notations to modulate the liveness of different parts of the code. This paper describes the initial design and development of Estuary, a browser-based collaborative projectional editing environment built on top of the popular TidalCycles language for the live coding of musical pattern. Key features of Estuary include a strict form of structure editing (making syntactical errors impossible), a click-only border-free approach to interface design, explicit notations to modulate the liveness of different parts of the code, and a server-based network collaboration system that can be used for many simultaneous collaborative live coding performances, as well as to present different views of the same live coding activity. Estuary has been developed using Reflex-DOM, a Haskell-based framework for web development whose strictness promises robustness and security advantages.",
"accessed": {
"date-parts": [
[
2022,
4,
15
]
]
},
"author": [
{
"family": "Ogborn",
"given": "David"
},
{
"family": "Beverley",
"given": "J."
}
],
"container-title": "www.semanticscholar.org",
"id": "https://www.semanticscholar.org/paper/Estuary_x37_3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b",
"issued": {
"date-parts": [
[
2017
]
]
},
"title": "Estuary: Browser-based Collaborative Projectional Live Coding of Musical Patterns",
"title-short": "Estuary",
"type": ""
}
},
"https://zenodo.org/record/6353969": {
"fetched": "2022-04-15T07:40:20.966Z",
"bibtex": [
"",
"@misc{mclean_feedforward_2020,",
" address = {Birmingham},",
" title = {Feedforward},",
" url = {https://zenodo.org/record/6353969},",
" abstract = {This is an improvised, from-scratch live coding performance. The NIME interface which this performance showcases is the new Feedfoward editor for the TidalCycles live coding environment. Feedforward is written in Haskell using the ncurses library for terminal-based user interfaces. It runs on low-powered hardware including the Raspberry Pi Zero, with formative testing of prototypes conducted with several groups of children between the ages of 8 and 14. Feedforward has a number of features designed to support improvised, multi-pattern live coding. Individual Tidal patterns are addressable with hotkeys for fast mute and unmuting. Each pattern has a stereo VU meter, to aid the quick matching of sound to pattern within a mix. In addition, TidalCycles has been extended to store context with each event, so that source code positions in its polyrhythmic sequence mini-notation are tracked. This allows steps to be highlighted in the source code when- ever they are active. This works even when Tidal combinators have been applied to manipulate the timeline. Formal evaluation has yet to take place, but this feature appears to support learning of how pattern manipulations work in Tidal. Feedforward and TidalCycles is free/open source software under a GPL licence version 3.0.},",
" urldate = {2022-04-15},",
" collaborator = {McLean, Alex},",
" month = jul,",
" year = {2020},",
"}",
""
],
"csl": {
"URL": "https://zenodo.org/record/6353969",
"abstract": "This is an improvised, from-scratch live coding performance. The NIME interface which this performance showcases is the new Feedfoward editor for the TidalCycles live coding environment. Feedforward is written in Haskell using the ncurses library for terminal-based user interfaces. It runs on low-powered hardware including the Raspberry Pi Zero, with formative testing of prototypes conducted with several groups of children between the ages of 8 and 14. Feedforward has a number of features designed to support improvised, multi-pattern live coding. Individual Tidal patterns are addressable with hotkeys for fast mute and unmuting. Each pattern has a stereo VU meter, to aid the quick matching of sound to pattern within a mix. In addition, TidalCycles has been extended to store context with each event, so that source code positions in its polyrhythmic sequence mini-notation are tracked. This allows steps to be highlighted in the source code when- ever they are active. This works even when Tidal combinators have been applied to manipulate the timeline. Formal evaluation has yet to take place, but this feature appears to support learning of how pattern manipulations work in Tidal. Feedforward and TidalCycles is free/open source software under a GPL licence version 3.0.",
"accessed": {
"date-parts": [
[
2022,
4,
15
]
]
},
"id": "https://zenodo.org/record/6353969",
"issued": {
"date-parts": [
[
2020,
7
]
]
},
"publisher-place": "Birmingham",
"title": "Feedforward",
"type": ""
}
},
"https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.72.1340": {
"fetched": "2022-04-24T21:09:16.724Z",
"bibtex": [
"",
"@inproceedings{toussaint_euclidean_2005,",
" title = {The {Euclidean} algorithm generates traditional musical rhythms},",
" url = {https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.72.1340},",
" abstract = {The Euclidean algorithm (which comes down to us from Euclids Elements) computes the greatest common divisor of two given integers. It is shown here that the structure of the Euclidean algorithm may be used to automatically generate, very efficiently, a large family of rhythms used as timelines (rhythmic ostinatos), in traditional world music. These rhythms, here dubbed Euclidean rhythms, have the property that their onset patterns are distributed as evenly as possible in a mathematically precise sense, and optimal manner. Euclidean rhythms are closely related to the family of Aksak rhythms studied by ethnomusicologists, and occur in a wide variety of other disciplines as well. For example they characterize algorithms for drawing digital straight lines in computer graphics, as well as algorithms for calculating leap years in calendar design. Euclidean rhythms also find application in nuclear physics accelerators and in computer science, and are closely related to several families of words and sequences of interest in the study of the combinatorics of words, such as mechanical words, Sturmian words, two-distance sequences, and Euclidean strings, to which the Euclidean rhythms are compared. 1.},",
" urldate = {2022-04-24},",
" booktitle = {In {Proceedings} of {BRIDGES}: {Mathematical} {Connections} in {Art}, {Music} and {Science}},",
" author = {Toussaint, Godfried},",
" year = {2005},",
" pages = {47--56},",
"}",
""
],
"csl": {
"URL": "https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.72.1340",
"abstract": "The Euclidean algorithm (which comes down to us from Euclids Elements) computes the greatest common divisor of two given integers. It is shown here that the structure of the Euclidean algorithm may be used to automatically generate, very efficiently, a large family of rhythms used as timelines (rhythmic ostinatos), in traditional world music. These rhythms, here dubbed Euclidean rhythms, have the property that their onset patterns are distributed as evenly as possible in a mathematically precise sense, and optimal manner. Euclidean rhythms are closely related to the family of Aksak rhythms studied by ethnomusicologists, and occur in a wide variety of other disciplines as well. For example they characterize algorithms for drawing digital straight lines in computer graphics, as well as algorithms for calculating leap years in calendar design. Euclidean rhythms also find application in nuclear physics accelerators and in computer science, and are closely related to several families of words and sequences of interest in the study of the combinatorics of words, such as mechanical words, Sturmian words, two-distance sequences, and Euclidean strings, to which the Euclidean rhythms are compared. 1.",
"accessed": {
"date-parts": [
[
2022,
4,
24
]
]
},
"author": [
{
"family": "Toussaint",
"given": "Godfried"
}
],
"container-title": "In Proceedings of BRIDGES: Mathematical Connections in Art, Music and Science",
"id": "https://citeseerx.ist.psu.edu/viewdoc/summary?doi_x61_10.1.1.72.1340",
"issued": {
"date-parts": [
[
2005
]
]
},
"page": "47-56",
"title": "The Euclidean algorithm generates traditional musical rhythms",
"type": "paper-conference"
}
},
"https://webaudioconf.com/posts/2021_8/": {
"fetched": "2022-04-24T21:14:10.409Z",
"bibtex": [
"",
"@misc{noauthor_wac_nodate,",
" title = {{WAC} {\\textbar} {Glicol}: {A} {Graph}-oriented {Live} {Coding} {Language} {Developed} with {Rust}, {WebAssembly} and {AudioWorklet}},",
" url = {https://webaudioconf.com/posts/2021_8/},",
" urldate = {2022-04-24},",
" journal = {webaudioconf.com},",
"}",
""
],
"csl": {
"URL": "https://webaudioconf.com/posts/2021_8/",
"accessed": {
"date-parts": [
[
2022,
4,
24
]
]
},
"container-title": "webaudioconf.com",
"id": "https://webaudioconf.com/posts/2021_8/",
"title": "WAC Glicol: A Graph-oriented Live Coding Language Developed with Rust, WebAssembly and AudioWorklet",
"title-short": "WAC Glicol",
"type": ""
}
},
"https://webaudioconf.com/posts/2019_38/": {
"fetched": "2022-04-24T21:14:46.954Z",
"bibtex": [
"",
"@misc{noauthor_wac_nodate,",
" title = {{WAC} {\\textbar} {FAUST} online {IDE}: dynamically compile and publish {FAUST} code as {WebAudio} {Plugins}},",
" url = {https://webaudioconf.com/posts/2019_38/},",
" urldate = {2022-04-24},",
" journal = {webaudioconf.com},",
"}",
""
],
"csl": {
"URL": "https://webaudioconf.com/posts/2019_38/",
"accessed": {
"date-parts": [
[
2022,
4,
24
]
]
},
"container-title": "webaudioconf.com",
"id": "https://webaudioconf.com/posts/2019_38/",
"title": "WAC FAUST online IDE: Dynamically compile and publish FAUST code as WebAudio Plugins",
"title-short": "WAC FAUST online IDE",
"type": ""
}
},
"https://strudel.tidalcycles.org": {
"fetched": "2022-04-24T21:14:47.822Z",
"bibtex": [
"",
"@misc{noauthor_strudel_nodate,",
" title = {Strudel {REPL}},",
" url = {https://strudel.tidalcycles.org/},",
" abstract = {Strudel REPL},",
" urldate = {2022-04-24},",
" journal = {strudel.tidalcycles.org},",
"}",
""
],
"csl": {
"URL": "https://strudel.tidalcycles.org/",
"abstract": "Strudel REPL",
"accessed": {
"date-parts": [
[
2022,
4,
24
]
]
},
"container-title": "strudel.tidalcycles.org",
"id": "https://strudel.tidalcycles.org",
"title": "Strudel REPL",
"type": ""
}
},
"https://hydra.ojack.xyz/docs/#/": {
"fetched": "2022-04-25T09:03:25.132Z",
"bibtex": [
"",
"@misc{noauthor_hydra_nodate,",
" title = {Hydra},",
" url = {https://hydra.ojack.xyz/docs/#/},",
" abstract = {Description},",
" urldate = {2022-04-25},",
" journal = {hydra.ojack.xyz},",
"}",
""
],
"csl": {
"URL": "https://hydra.ojack.xyz/docs/#/",
"abstract": "Description",
"accessed": {
"date-parts": [
[
2022,
4,
25
]
]
},
"container-title": "hydra.ojack.xyz",
"id": "https://hydra.ojack.xyz/docs/_x35_/",
"title": "Hydra",
"type": ""
}
},
"https://mikesol.github.io/purescript-wags/": {
"fetched": "2022-04-25T09:03:26.456Z",
"bibtex": [
"",
"@misc{noauthor_wags_nodate,",
" title = {Wags documentation},",
" url = {https://mikesol.github.io/purescript-wags/},",
" urldate = {2022-04-25},",
" journal = {mikesol.github.io},",
"}",
""
],
"csl": {
"URL": "https://mikesol.github.io/purescript-wags/",
"accessed": {
"date-parts": [
[
2022,
4,
25
]
]
},
"container-title": "mikesol.github.io",
"id": "https://mikesol.github.io/purescript-wags/",
"title": "Wags documentation",
"type": ""
}
},
"https://github.com/tidalcycles/strudel": {
"fetched": "2022-04-25T09:15:32.518Z",
"bibtex": [
"",
"@misc{noauthor_strudel_2022,",
" title = {strudel},",
" copyright = {GPL-3.0},",
" url = {https://github.com/tidalcycles/strudel},",
" abstract = {Experimental port of tidalcycles to Javascript},",
" urldate = {2022-04-25},",
" publisher = {TidalCycles},",
" month = apr,",
" year = {2022},",
" note = {original-date: 2022-01-22T20:24:35Z},",
" keywords = {javascript, livecoding, tidal, tidalcycles, algorave, algorithmic-patterns},",
"}",
""
],
"csl": {
"URL": "https://github.com/tidalcycles/strudel",
"abstract": "Experimental port of tidalcycles to Javascript",
"accessed": {
"date-parts": [
[
2022,
4,
25
]
]
},
"id": "https://github.com/tidalcycles/strudel",
"issued": {
"date-parts": [
[
2022,
4
]
]
},
"keyword": "javascript, livecoding, tidal, tidalcycles, algorave, algorithmic-patterns",
"note": "original-date: 2022-01-22T20:24:35Z",
"publisher": "TidalCycles",
"title": "Strudel",
"type": ""
}
}
}
}

552
paper/demo-preprocessed.md Normal file
View File

@ -0,0 +1,552 @@
---
date: 2022-04-15
references:
- abstract: In this artist statement, I will discuss the tension between
source code as an interactive system for performers and source code
as information and entertainment for audiences in live-coding
performances. I then describe augmentations I developed for the
presentation of source code in the live-coding environment Gibber,
including animations and annotations that visually reveal aspects of
system state during performances. I briefly describe audience
responses to these techniques and, more importantly, how they are
critical to my own artistic practice.
accessed:
date-parts:
- - 2022
- 3
- 24
author:
- family: Roberts
given: Charles
container-title: International Journal of Performance Arts and Digital
Media
DOI: 10.1080/14794713.2016.1227602
id: "https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode_x61_rpdm20"
ISSN: 1479-4713
issue: 2
issued:
date-parts:
- - 2016
- 7
keyword: Live coding, psychology of programming, notation, audiences,
algorithms
page: 201-206
title: Code as information and code as spectacle
type: article-journal
URL: "https://doi.org/10.1080/14794713.2016.1227602"
volume: 12
- abstract: The TidalCycles (or Tidal for short) live coding environment
has been developed since around 2009, via several rewrites of its
core representation. Rather than having fixed goals, this
development has been guided by use, motivated by the open aim to
make music. This development process can be seen as a long-form
improvisation, with insights into the nature of Tidal gained through
the process of writing it, feeding back to guide the next steps of
development. This brings the worrying thought that key insights will
have been missed along this development journey, that would
otherwise have lead to very different software. Indeed participants
at beginners' workshops that I have lead or co-lead have often asked
questions without good answers, because they made deficiencies or
missing features in the software clear. It is well known that a
beginner's mind is able to see much that an expert has become blind
to. Running workshops are an excellent way to find new development
ideas, but the present paper explores a different technique -- the
rewrite.
accessed:
date-parts:
- - 2022
- 3
- 24
id: "https://zenodo.org/record/5788732"
issued:
date-parts:
- - 2021
- 12
keyword: live coding, algorithmic pattern, tidalcycles, haskell,
python
publisher-place: Valdivia, Chile
title: Alternate Timelines for TidalCycles
URL: "https://zenodo.org/record/5788732"
- abstract: A JavaScript dialect of its mini-notation for pattern is
created, enabling easy integration with creative coding tools and an
accompanying technique for visually annotating the playback of
TidalCycles patterns over time. TidalCycles has rapidly become the
most popular system for many styles of live coding performance, in
particular Algoraves. We created a JavaScript dialect of its
mini-notation for pattern, enabling easy integration with creative
coding tools. Our research pairs a formalism describing the
mini-notation with a small JavaScript library for generating events
over time; this library is suitable for generating events inside of
an AudioWorkletProcessor thread and for assisting with scheduling in
JavaScript environments more generally. We describe integrating the
library into the two live coding systems, Gibber and Hydra, and
discuss an accompanying technique for visually annotating the
playback of TidalCycles patterns over time.
accessed:
date-parts:
- - 2022
- 4
- 12
author:
- family: Roberts
given: Charles
container-title: www.semanticscholar.org
id: "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42"
issued:
date-parts:
- - 2019
title: Bringing the TidalCycles Mini-Notation to the Browser
URL: "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42"
- abstract: In this paper we introduce "version zero" of TidalVortex, an
alternative implementation of the TidalCycles live coding system,
using the Python programming language.  This is open-ended work,
exploring what happens when we try to extract the 'essence' of a
system like TidalCycles and translate it into another programming
language, while taking advantage of the affordance of its new host.
First, we review the substantial prior art in porting TidalCycles,
and in representing musical patterns in Python. We then compare
equivalent patterns written in Haskell (TidalCycles) and Python
(TidalVortex), and relate implementation details of how functional
reactive paradigms have translated from the pure functional,
strongly typed Haskell to the more multi-paradigm, dynamically typed
Python. Finally, we conclude with reflections and generalisable
outcomes.
accessed:
date-parts:
- - 2022
- 4
- 14
id: "https://zenodo.org/record/6456380"
issued:
date-parts:
- - 2022
- 4
publisher-place: Limerick, Ireland
title: TidalVortex Zero
URL: "https://zenodo.org/record/6456380"
- abstract: This paper brings together two main perspectives on
algorithmic pattern. First, the writing of musical patterns in live
coding performance, and second, the weaving of patterns in textiles.
In both cases, algorithmic pattern is an interface between the human
and the outcome, where small changes have far-reaching impact on the
results. By bringing contemporary live coding and ancient textile
approaches together, we reach a common view of pattern as
algorithmic movement (e.g. looping, shifting, reflecting,
interfering) in the making of things. This works beyond the usual
definition of pattern used in musical interfaces, of mere repeating
sequences. We conclude by considering the place of algorithmic
pattern in a wider activity of making.
accessed:
date-parts:
- - 2022
- 4
- 15
id: "https://zenodo.org/record/4299661"
issued:
date-parts:
- - 2020
- 7
keyword: pattern, tidalcycles, algorithmic music, textiles, live
coding, algorave
publisher-place: Birmingham UK
title: Algorithmic Pattern
URL: "https://zenodo.org/record/4299661"
- accessed:
date-parts:
- - 2022
- 4
- 15
author:
- family: Charlie
given: Roberts
- family: Joann
given: Kuchera-Morin
container-title: International Computer Music Conference Proceedings
id: "https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/--gibber-live-coding-audio-in-the-browser?page_x61_root;size_x61_150;view_x61_text"
ISSN: 2223-3881
issued:
date-parts:
- - 2012
title: "GIBBER: LIVE CODING AUDIO IN THE BROWSER"
title-short: GIBBER
type: article-journal
URL: "https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/%E2%80%93gibber-live-coding-audio-in-the-browser?page=root;size=150;view=text"
volume: 2012
- abstract: Estuary is a browser-based collaborative projectional
editing environment built on top of the popular TidalCycles language
for the live coding of musical pattern that includes a strict form
of structure editing, a click-only border-free approach to interface
design, and explicit notations to modulate the liveness of different
parts of the code. This paper describes the initial design and
development of Estuary, a browser-based collaborative projectional
editing environment built on top of the popular TidalCycles language
for the live coding of musical pattern. Key features of Estuary
include a strict form of structure editing (making syntactical
errors impossible), a click-only border-free approach to interface
design, explicit notations to modulate the liveness of different
parts of the code, and a server-based network collaboration system
that can be used for many simultaneous collaborative live coding
performances, as well as to present different views of the same live
coding activity. Estuary has been developed using Reflex-DOM, a
Haskell-based framework for web development whose strictness
promises robustness and security advantages.
accessed:
date-parts:
- - 2022
- 4
- 15
author:
- family: Ogborn
given: David
- family: Beverley
given: J.
container-title: www.semanticscholar.org
id: "https://www.semanticscholar.org/paper/Estuary_x37_3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b"
issued:
date-parts:
- - 2017
title: "Estuary: Browser-based Collaborative Projectional Live Coding
of Musical Patterns"
title-short: Estuary
URL: "https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b"
- abstract: This is an improvised, from-scratch live coding performance.
The NIME interface which this performance showcases is the new
Feedfoward editor for the TidalCycles live coding environment.
Feedforward is written in Haskell using the ncurses library for
terminal-based user interfaces. It runs on low-powered hardware
including the Raspberry Pi Zero, with formative testing of
prototypes conducted with several groups of children between the
ages of 8 and 14. Feedforward has a number of features designed to
support improvised, multi-pattern live coding. Individual Tidal
patterns are addressable with hotkeys for fast mute and unmuting.
Each pattern has a stereo VU meter, to aid the quick matching of
sound to pattern within a mix. In addition, TidalCycles has been
extended to store context with each event, so that source code
positions in its polyrhythmic sequence mini-notation are tracked.
This allows steps to be highlighted in the source code when- ever
they are active. This works even when Tidal combinators have been
applied to manipulate the timeline. Formal evaluation has yet to
take place, but this feature appears to support learning of how
pattern manipulations work in Tidal. Feedforward and TidalCycles is
free/open source software under a GPL licence version 3.0.
accessed:
date-parts:
- - 2022
- 4
- 15
id: "https://zenodo.org/record/6353969"
issued:
date-parts:
- - 2020
- 7
publisher-place: Birmingham
title: Feedforward
URL: "https://zenodo.org/record/6353969"
- abstract: The Euclidean algorithm (which comes down to us from
Euclid's Elements) computes the greatest common divisor of two given
integers. It is shown here that the structure of the Euclidean
algorithm may be used to automatically generate, very efficiently, a
large family of rhythms used as timelines (rhythmic ostinatos), in
traditional world music. These rhythms, here dubbed Euclidean
rhythms, have the property that their onset patterns are distributed
as evenly as possible in a mathematically precise sense, and optimal
manner. Euclidean rhythms are closely related to the family of Aksak
rhythms studied by ethnomusicologists, and occur in a wide variety
of other disciplines as well. For example they characterize
algorithms for drawing digital straight lines in computer graphics,
as well as algorithms for calculating leap years in calendar design.
Euclidean rhythms also find application in nuclear physics
accelerators and in computer science, and are closely related to
several families of words and sequences of interest in the study of
the combinatorics of words, such as mechanical words, Sturmian
words, two-distance sequences, and Euclidean strings, to which the
Euclidean rhythms are compared. 1.
accessed:
date-parts:
- - 2022
- 4
- 24
author:
- family: Toussaint
given: Godfried
container-title: "In Proceedings of BRIDGES: Mathematical Connections
in Art, Music and Science"
id: "https://citeseerx.ist.psu.edu/viewdoc/summary?doi_x61_10.1.1.72.1340"
issued:
date-parts:
- - 2005
page: 47-56
title: The Euclidean algorithm generates traditional musical rhythms
type: paper-conference
URL: "https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.72.1340"
- accessed:
date-parts:
- - 2022
- 4
- 24
container-title: webaudioconf.com
id: "https://webaudioconf.com/posts/2021_8/"
title: "WAC Glicol: A Graph-oriented Live Coding Language Developed
with Rust, WebAssembly and AudioWorklet"
title-short: WAC Glicol
URL: "https://webaudioconf.com/posts/2021_8/"
- accessed:
date-parts:
- - 2022
- 4
- 24
container-title: webaudioconf.com
id: "https://webaudioconf.com/posts/2019_38/"
title: "WAC FAUST online IDE: Dynamically compile and publish FAUST
code as WebAudio Plugins"
title-short: WAC FAUST online IDE
URL: "https://webaudioconf.com/posts/2019_38/"
- abstract: Strudel REPL
accessed:
date-parts:
- - 2022
- 4
- 24
container-title: strudel.tidalcycles.org
id: "https://strudel.tidalcycles.org"
title: Strudel REPL
URL: "https://strudel.tidalcycles.org/"
- abstract: Description
accessed:
date-parts:
- - 2022
- 4
- 25
container-title: hydra.ojack.xyz
id: "https://hydra.ojack.xyz/docs/\\_x35\\_/"
title: Hydra
URL: "https://hydra.ojack.xyz/docs/#/"
- accessed:
date-parts:
- - 2022
- 4
- 25
container-title: mikesol.github.io
id: "https://mikesol.github.io/purescript-wags/"
title: Wags documentation
URL: "https://mikesol.github.io/purescript-wags/"
- abstract: Experimental port of tidalcycles to Javascript
accessed:
date-parts:
- - 2022
- 4
- 25
id: "https://github.com/tidalcycles/strudel"
issued:
date-parts:
- - 2022
- 4
keyword: javascript, livecoding, tidal, tidalcycles, algorave,
algorithmic-patterns
note: "original-date: 2022-01-22T20:24:35Z"
publisher: TidalCycles
title: Strudel
URL: "https://github.com/tidalcycles/strudel"
title: "Strudel: Algorithmic Patterns for the Web"
url2cite: all-links
---
# Introduction
This paper introduces Strudel (or sometimes 'StrudelCycles'), an
alternative implementation of the Tidal (or 'TidalCycles') live coding
system, using the JavaScript programming language. Strudel is an attempt
to make live coding more accessible, by creating a system that runs
entirely in the browser, while opening Tidal's approach to algorithmic
patterns [@https://zenodo.org/record/4299661] up to modern audio/visual
web technologies. The Strudel REPL is a live code editor dedicated to
manipulating strudel patterns while they play, with builtin visual
feedback. While Strudel is written in JavaScript, the API is optimized
for simplicity and readability by applying code transformations on the
syntax tree level, allowing language operations that would otherwise be
impossible. The application supports multiple ways to output sound,
including Tone.js, Web Audio nodes, OSC (Open Sound Control) messages,
Web Serial and Web MIDI. The project is split into multiple packages,
allowing granular reuse in other applications. Apart from TidalCycles,
Strudel draws inspiration from many prior existing projects like
TidalVortex [@https://zenodo.org/record/6456380], Gibber
[@{https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/gibber-live-coding-audio-in-the-browser?page_x61_root;size_x61_150;view_x61_text}],
Estuary
[@https://www.semanticscholar.org/paper/Estuary_x37_3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b],
Hydra [@{https://hydra.ojack.xyz/docs/_x35_/}], Wags
[@{https://mikesol.github.io/purescript-wags/}] and Feedforward
[@https://zenodo.org/record/6353969].
# Porting from Haskell
The original Tidal is implemented as a domain specific language (DSL),
embedded in the Haskell pure functional programming language, taking
advantage of Haskell's terse syntax and advanced, 'strong' type system.
Javascript on the other hand, is a multi-paradigm programming language,
with a dynamic type system. Because Tidal leans heavily on many of
Haskell's more unique features, it was not always clear that it could
meaningfully be ported to a multi-paradigm scripting language. However,
this already proved to be the case with an earlier port to Python
\[TidalVortex; @https://zenodo.org/record/6456380\], and we have now
successfully implemented Tidal's pure functional representation of
patterns in Strudel, including partial application, and functor,
applicative and monad structures. Over the past few months since the
project started in January 2022, a large part of Tidal's functionality
has already been ported, including it's mini-notation for polymetric
sequences, and a large part of its library of pattern manipulations. The
result is a terse and highly composable system, where just about
everything is a pattern, that may be transformed and combined with other
patterns in a myriad of ways.
# Representing Patterns
Patterns are the essence of Tidal. Its patterns are abstract entities
that represent flows of time as functions, adapting a technique called
pure functional reactive programming. Taking a time span as its input, a
Pattern can output a set of events that happen within that time span. It
depends on the structure of the Pattern how the events are located in
time. From now on, this process of generating events from a time span
will be called **querying**. Example:
<MiniRepl tune={`const pattern = sequence(c3, [e3, g3]);
const events = pattern.query(0, 1);
console.log(events.map(e => e.show()))`} />
In this example, we create a pattern using the `sequence` function and
**query** it for the time span from `0` to `1`. Those numbers represent
units of time called **cycles**. The length of one cycle depends on the
tempo, which defaults to one cycle per second. The resulting events are:
<MiniRepl tune={`[{ value: 'c3', begin: 0, end: 1/2 },
{ value: 'e3', begin: 1/2, end: 3/4 },
{ value: 'g3', begin: 3/4, end: 1 }]`} />
Each event has a value, a begin time and an end time, where time is
represented as a fraction. In the above case, the events are placed in
sequential order, where c3 takes the first half, and e3 and g3 together
take the second half. This temporal placement is the result of the
`sequence` function, which divides its arguments equally over one cycle.
If an argument is an array, the same rule applies to that part of the
cycle. In the example, e3 and g3 are divided equally over the second
half of the whole cycle.
In the REPL, the user only has to type in the pattern itself, the
querying will be handled by the scheduler. The scheduler will repeatedly
query the pattern for events, which then will be used for playback.
![Screenshot of the Strudel editor, including piano-roll
visualisation.](images/strudel-screenshot.png){width="43%"}
# Making Patterns
In practice, the end-user live coder will not deal with constructing
patterns directly, but will rather build patterns using Strudel's
extensive combinator library to create, combine and transform patterns.
The live coder may use the `sequence` function as already seen above, or
more often the mini-notation for even terser notation of rhythmic
sequences. Such sequences are often treated only a starting point for
manipulation, where they then are undergo pattern transformations such
as repetition, symmetry, interference/combination or randomisation,
potentially at multiple timescales. Because Strudel patterns are
represented as pure functions of time rather than as data structures,
very long and complex generative results can be represented and
manipulated without having to store the resulting sequences in memory.
# Pattern Example
The following example showcases how patterns can be utilized to create
musical complexity from simple parts, using repetition and interference:
<MiniRepl tune={`"<0 2 [4 6](3,4,1) 3*2>".scale('D minor')
.off(1/4, scaleTranspose(2))
.off(1/2, scaleTranspose(6))
.legato(.5)
.echo(4, 1/8, .5)
.tone((await piano()).chain(out()))
.pianoroll()`} />
The pattern starts with a rhythm of numbers in mini notation, which are
interpreted inside the scale of D minor. Without the scale function, the
first line can be expressed as:
<MiniRepl tune={`"<d3 f3 [a3 c3](3, 4, 1) g3*2>"`} />
This line could also be expressed without mini notation:
<MiniRepl tune={`slowcat(d3, f3, [a3, c3].euclid(3, 4, 1), g3.fast(2))`} />
Here is a short description of all the functions used:
- slowcat: play elements sequentially, where each lasts one cycle
- brackets: elements inside brackets are divided equally over the time
of their parent
- euclid(p, s, o): place p pulses evenly over s steps, with offset o
[@https://citeseerx.ist.psu.edu/viewdoc/summary?doi_x61_10.1.1.72.1340]
- fast(n): speed up by n. `g3.fast(2)` will play g3 two times.
- off(n, f): copy each event, offset it by n cycles and apply function
f
- legato(n): multiply duration of event with n
- echo(t, n, v): copy each event t times, with n cycles in between
each copy, decreasing velocity by v
- tone(instrument): play back each event with the given Tone.js
instrument
- pianoroll(): visualize events as midi notes in a pianoroll
# Future Outlook
The project is still young, with many features on the horizon. As
general guiding principles, Strudel aims to be
1. accessible
2. consistent with Tidal's approach to pattern
3. modular and extensible
The main accessibility advantage over Tidal is the zero install browser
environment. It is not yet accessible to screen reader users, but will
be soon with the integration of the CodeMirror 6 editor. While Strudel
can control Tidal's SuperDirt audio system via OSC, it requires the user
to install SuperCollider and its sc3plugins library, which can be
difficult. Without SuperDirt, Strudel is able to output sound itself via
Tone.js, however this is limited both in terms of available features and
runtime performance. For the future, it is planned to integrate
alternative sound engines such as glicol
[@{https://webaudioconf.com/posts/2021_8/}] and faust
[@{https://webaudioconf.com/posts/2019_38/}]. To improve compatibility
with Tidal, more Tidal functions are planned to be ported, as well as
full compatibility with SuperDirt. Besides sound, other ways to render
events are being explored, such as graphical, and choreographic output.
We are also looking into alternative ways of editing patterns, including
multi-user editing for network music, parsing a novel syntax to escape
the constraints of javascript, and developing hardware/e-textile
interfaces.
# Links
The Strudel REPL is available at [https://strudel.tidalcycles.org
[@https://strudel.tidalcycles.org]](https://strudel.tidalcycles.org){.uri
cite-meta="{\"URL\":\"https://strudel.tidalcycles.org/\",\"abstract\":\"Strudel REPL\",\"accessed\":{\"date-parts\":[[2022,4,24]]},\"container-title\":\"strudel.tidalcycles.org\",\"id\":\"https://strudel.tidalcycles.org\",\"title\":\"Strudel REPL\",\"type\":\"\"}"},
including an interactive tutorial. The repository is at
[https://github.com/tidalcycles/strudel
[@https://github.com/tidalcycles/strudel]](https://github.com/tidalcycles/strudel){.uri
cite-meta="{\"URL\":\"https://github.com/tidalcycles/strudel\",\"abstract\":\"Experimental port of tidalcycles to Javascript\",\"accessed\":{\"date-parts\":[[2022,4,25]]},\"id\":\"https://github.com/tidalcycles/strudel\",\"issued\":{\"date-parts\":[[2022,4]]},\"keyword\":\"javascript, livecoding, tidal, tidalcycles, algorave, algorithmic-patterns\",\"note\":\"original-date: 2022-01-22T20:24:35Z\",\"publisher\":\"TidalCycles\",\"title\":\"Strudel\",\"type\":\"\"}"},
all the code is open source under the GPL-3.0 License.
# Technical requirements
- Space for one laptop + small audio interface (20 cm x 20cm), with
mains power.
- Stereo sound system, either placed behind presenter (for direct
monitoring) or with additional stereo monitors.
- Audio from audio interface: stereo pair 6,3mm jack outputs
(balanced)
- Projector / screen (HDMI.)
# Acknowledgments
Thanks to the Strudel and wider Tidal, live coding, webaudio and
free/open source software communities for inspiration and support. Alex
McLean's work on this project is supported by a UKRI Future Leaders
Fellowship \[grant number MR/V025260/1\].
# References

140
paper/demo.md Normal file
View File

@ -0,0 +1,140 @@
---
title: 'Strudel: Algorithmic Patterns for the Web'
date: '2022-04-15'
url2cite: all-links
---
# Introduction
This paper introduces Strudel (or sometimes 'StrudelCycles'), an alternative implementation of the Tidal (or 'TidalCycles') live coding system, using the JavaScript programming language. Strudel is an attempt to make live coding more accessible, by creating a system that runs entirely in the browser, while opening Tidal's approach to algorithmic patterns [@algorithmicpattern] up to modern audio/visual web technologies. The Strudel REPL is a live code editor dedicated to manipulating strudel patterns while they play, with builtin visual feedback. While Strudel is written in JavaScript, the API is optimized for simplicity and readability by applying code transformations on the syntax tree level, allowing language operations that would otherwise be impossible. The application supports multiple ways to output sound, including Tone.js, Web Audio nodes, OSC (Open Sound Control) messages, Web Serial and Web MIDI. The project is split into multiple packages, allowing granular reuse in other applications. Apart from TidalCycles, Strudel draws inspiration from many prior existing projects like TidalVortex [@tidalvortex], Gibber [@gibber], Estuary [@estuary], Hydra [@hydra], Wags [@wags] and Feedforward [@feedforward].
# Porting from Haskell
The original Tidal is implemented as a domain specific language (DSL), embedded in the Haskell pure functional programming language, taking advantage of Haskell's terse syntax and advanced, 'strong' type system. Javascript on the other hand, is a multi-paradigm programming language, with a dynamic type system. Because Tidal leans heavily on many of Haskell's more unique features, it was not always clear that it could meaningfully be ported to a multi-paradigm scripting language. However, this already proved to be the case with an earlier port to Python [TidalVortex; @tidalvortex], and we have now successfully implemented Tidal's pure functional representation of patterns in Strudel, including partial application, and functor, applicative and monad structures. Over the past few months since the project started in January 2022, a large part of Tidal's functionality has already been ported, including it's mini-notation for polymetric sequences, and a large part of its library of pattern manipulations. The result is a terse and highly composable system, where just about everything is a pattern, that may be transformed and combined with other patterns in a myriad of ways.
# Representing Patterns
Patterns are the essence of Tidal. Its patterns are abstract entities that represent flows of time as functions, adapting a technique called pure functional reactive programming.
Taking a time span as its input, a Pattern can output a set of events that happen within that time span.
It depends on the structure of the Pattern how the events are located in time.
From now on, this process of generating events from a time span will be called **querying**.
Example:
```js
const pattern = sequence(c3, [e3, g3]);
const events = pattern.query(0, 1);
console.log(events.map(e => e.show()))
```
In this example, we create a pattern using the `sequence` function and **query** it for the time span from `0` to `1`.
Those numbers represent units of time called **cycles**. The length of one cycle depends on the tempo, which defaults to one cycle per second.
The resulting events are:
```js
[{ value: 'c3', begin: 0, end: 1/2 },
{ value: 'e3', begin: 1/2, end: 3/4 },
{ value: 'g3', begin: 3/4, end: 1 }]
```
Each event has a value, a begin time and an end time, where time is represented as a fraction.
In the above case, the events are placed in sequential order, where c3 takes the first half, and e3 and g3 together take the second half.
This temporal placement is the result of the `sequence` function, which divides its arguments equally over one cycle.
If an argument is an array, the same rule applies to that part of the cycle. In the example, e3 and g3 are divided equally over the second half of the whole cycle.
In the REPL, the user only has to type in the pattern itself, the querying will be handled by the scheduler.
The scheduler will repeatedly query the pattern for events, which then will be used for playback.
![Screenshot of the Strudel editor, including piano-roll visualisation.](images/strudel-screenshot.png){ width=43% }
# Making Patterns
In practice, the end-user live coder will not deal with constructing patterns directly, but will rather build patterns using Strudel's extensive combinator library to create, combine and transform patterns.
The live coder may use the `sequence` function as already seen above, or more often the mini-notation for even terser notation of rhythmic sequences. Such sequences are often treated only a starting point for manipulation, where they then are undergo pattern transformations such as repetition, symmetry, interference/combination or randomisation, potentially at multiple timescales. Because Strudel patterns are represented as pure functions of time rather than as data structures, very long and complex generative results can be represented and manipulated without having to store the resulting sequences in memory.
# Pattern Example
The following example showcases how patterns can be utilized to create musical complexity from simple parts, using repetition and interference:
```js
"<0 2 [4 6](3,4,1) 3*2>".scale('D minor')
.off(1/4, scaleTranspose(2))
.off(1/2, scaleTranspose(6))
.legato(.5)
.echo(4, 1/8, .5)
.tone((await piano()).chain(out()))
.pianoroll()
```
The pattern starts with a rhythm of numbers in mini notation, which are interpreted inside the scale of D minor.
Without the scale function, the first line can be expressed as:
```js
"<d3 f3 [a3 c3](3, 4, 1) g3*2>"
```
This line could also be expressed without mini notation:
```js
slowcat(d3, f3, [a3, c3].euclid(3, 4, 1), g3.fast(2))
```
Here is a short description of all the functions used:
- slowcat: play elements sequentially, where each lasts one cycle
- brackets: elements inside brackets are divided equally over the time of their parent
- euclid(p, s, o): place p pulses evenly over s steps, with offset o [@godfried]
- fast(n): speed up by n. `g3.fast(2)` will play g3 two times.
- off(n, f): copy each event, offset it by n cycles and apply function f
- legato(n): multiply duration of event with n
- echo(t, n, v): copy each event t times, with n cycles in between each copy, decreasing velocity by v
- tone(instrument): play back each event with the given Tone.js instrument
- pianoroll(): visualize events as midi notes in a pianoroll
# Future Outlook
The project is still young, with many features on the horizon. As general guiding principles, Strudel aims to be
1. accessible
2. consistent with Tidal's approach to pattern
3. modular and extensible
The main accessibility advantage over Tidal is the zero install browser environment. It is not yet accessible to screen reader users, but will be soon with the integration of the CodeMirror 6 editor. While Strudel can control Tidal's SuperDirt audio system via OSC, it requires the user to install SuperCollider and its sc3plugins library, which can be difficult. Without SuperDirt, Strudel is able to output sound itself via Tone.js, however this is limited both in terms of available features and runtime performance. For the future, it is planned to integrate alternative sound engines such as glicol [@glicol] and faust [@faust]. To improve compatibility with Tidal, more Tidal functions are planned to be ported, as well as full compatibility with SuperDirt. Besides sound, other ways to render events are being explored, such as graphical, and choreographic output. We are also looking into alternative ways of editing patterns, including multi-user editing for network music, parsing a novel syntax to escape the constraints of javascript, and developing hardware/e-textile interfaces.
# Links
The Strudel REPL is available at <https://strudel.tidalcycles.org>, including an interactive tutorial.
The repository is at <https://github.com/tidalcycles/strudel>, all the code is open source under the GPL-3.0 License.
# Technical requirements
- Space for one laptop + small audio interface (20 cm x 20cm), with mains power.
- Stereo sound system, either placed behind presenter (for direct monitoring) or with additional stereo monitors.
- Audio from audio interface: stereo pair 6,3mm jack outputs (balanced)
- Projector / screen (HDMI.)
# Acknowledgments
Thanks to the Strudel and wider Tidal, live coding, webaudio and free/open source software communities for inspiration and support. Alex McLean's work on this project is supported by a UKRI Future Leaders Fellowship [grant number MR/V025260/1].
# References
[@roberts2016]: https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode=rpdm20
[@gibber]: https://quod.lib.umich.edu/i/icmc/bbp2372.2012.011/2/--gibber-live-coding-audio-in-the-browser?page=root;size=150;view=text
[@alternate-timelines]: https://zenodo.org/record/5788732
[@tidal.pegjs]: https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42
[@tidalvortex]: https://zenodo.org/record/6456380
[@estuary]: https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b
[@tidalcycles]: https://dl.acm.org/doi/10.1145/2633638.2633647
[@hession]: https://www.scopus.com/record/display.uri?eid=2-s2.0-84907386880&origin=inward&txGid=03307e26fba02a27bdc68bda462016f6266316467_Extending_Instruments_with_Live_Algorithms_in_a_Percussion_Code_Duo
[@spiegel]: https://www.academia.edu/664807/Manipulations_of_musical_patterns
[@bel]: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.517.7129
[@algorithmicpattern]: https://zenodo.org/record/4299661
[@fabricating]: https://zenodo.org/record/2155745
[@cyclic-patterns]: https://zenodo.org/record/1548969
[@feedforward]: https://zenodo.org/record/6353969
[@godfried]: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.72.1340
[@glicol]: https://webaudioconf.com/posts/2021_8/
[@faust]: https://webaudioconf.com/posts/2019_38/
[@wags]: https://mikesol.github.io/purescript-wags/
[@hydra]: https://hydra.ojack.xyz/docs/#/

BIN
paper/demo.pdf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

View File

@ -6,12 +6,12 @@ fi
# --template=templates/template.latex \
pandoc -s paper.md \
pandoc -s demo.md \
--from markdown+auto_identifiers --pdf-engine=xelatex --template tex/latex-template.tex -V colorlinks --number-sections \
--filter=pandoc-url2cite --citeproc --pdf-engine=xelatex \
--dpi=300 -o paper.pdf
--dpi=300 -o demo.pdf
pandoc -s paper.md --filter bin/code-filter.py --filter=pandoc-url2cite \
pandoc -s demo.md --filter bin/code-filter.py --filter=pandoc-url2cite \
--citeproc \
-t markdown-citations -t markdown-fenced_divs \
-o paper-preprocessed.md
-o demo-preprocessed.md

View File

@ -67,36 +67,193 @@ references:
publisher-place: Valdivia, Chile
title: Alternate Timelines for TidalCycles
URL: "https://zenodo.org/record/5788732"
- abstract: A JavaScript dialect of its mini-notation for pattern is
created, enabling easy integration with creative coding tools and an
accompanying technique for visually annotating the playback of
TidalCycles patterns over time. TidalCycles has rapidly become the
most popular system for many styles of live coding performance, in
particular Algoraves. We created a JavaScript dialect of its
mini-notation for pattern, enabling easy integration with creative
coding tools. Our research pairs a formalism describing the
mini-notation with a small JavaScript library for generating events
over time; this library is suitable for generating events inside of
an AudioWorkletProcessor thread and for assisting with scheduling in
JavaScript environments more generally. We describe integrating the
library into the two live coding systems, Gibber and Hydra, and
discuss an accompanying technique for visually annotating the
playback of TidalCycles patterns over time.
accessed:
date-parts:
- - 2022
- 4
- 12
author:
- family: Roberts
given: Charles
container-title: www.semanticscholar.org
id: "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42"
issued:
date-parts:
- - 2019
title: Bringing the TidalCycles Mini-Notation to the Browser
URL: "https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42"
title: Strudel
url2cite: all-links
---
# Introduction
That
@https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode_x61_rpdm20
are excellent, I reference their work at least twice per sentence
[@https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode_x61_rpdm20,
p. 3]. Another reference [@https://zenodo.org/record/5788732].
<MiniRepl tune={`"1 2 3"`} />
This paper introduces Strudel, an alternative implementation of the
TidalCycles live coding system, using the JavaScript programming
language.
# Background
General motivations / related work. Reference vortex paper and summarise
its background.
The reimplementation of TidalCycles in Python (cite TidalVortex) showed
that it is possible to translate pure functional reactive programming
ideas to a multi paradigm language. It proved to be a stepping stone to
move to other multi-paradigm languages, like JavaScript. A significant
part of of the Python codebase could be ported to JavaScript by
syntactical adjustments.
# Introducing TidalStrudel
(do we want to call it TidalStrudel once, and Strudel for short from
then on as with vortex? Or just stick with Strudel? Should we start
calling TidalCycles just Cycles??)
calling TidalCycles just Cycles?? froos: I think TidalStrudel sounds a
bit weird, but we can stick to the TidalX naming scheme if that's
important. For me, StrudelCycles sounds better, because it has 3/4
phonems in common with TidalCycles)
- Motivating musical example
# Tidal patterns
(should we explain shortly what tidal patterns do in general here?)
The essence of TidalCycles are Patterns. Patterns are abstract entities
that represent flows of time. Taking a time span as its input, a Pattern
can output a set of events that happen within that time span. It depends
on the structure of the Pattern where the events are placed. From now
on, this process of generating events from a time span will be called
**querying**. Example:
<MiniRepl tune={`const pattern = sequence(c3, [e3, g3]);
const events = pattern.query(0, 1);
console.log(events.map(e => e.show()))`} />
In this example, we create a pattern using the `sequence` function and
**query** it for the timespan from `0` to `1`. Those numbers represent
units of time called **cycles**. The length of one cycle defaults to one
second, but could be any number of seconds. The console output looks
like this:
<MiniRepl tune={`(0 -> 1/2 c3)
(1/2 -> 3/4 e3)
(3/2 -> 1 g3)`} />
In this output, each line represents one event. The two fractions
represent the begin and end time of the event, followed by its value. In
this case, the events are placed in sequential order, where c3 takes the
first half, and e3 and g3 together take the second half. This temporal
placement is the result of the `sequence` function, which divides its
arguments equally over one cycle. If an argument is an array, the same
rule applies to that part of the sequence. In our example e3 and g3 are
divided equally over the second half of the whole sequence.
# Mini Notation
In this example, the Pattern is created using the `mini` function, which
parses Tidal's Mini Notation. The Mini Notation is a Domain Specific
Language (DSL) that allows expressing rhythms in a short mannger.
- Some comparisons of -Strudel with -Vortex and -Cycles code?
(the following examples are from vortex paper, with added js versions)
## 1
<MiniRepl tune={`sound "bd ~ [sd cp]"`} />
<MiniRepl tune={`sound("bd", silence, ["sd", "cp"])`} />
<MiniRepl tune={`sound("bd ~ [sd cp]")`} />
without mini notation:
<MiniRepl tune={`sound $ cat
[pure "bd", silence,
cat(pure "sd", pure "cp")]`} />
<MiniRepl tune={`sound('bd', silence, cat('sd', 'cp'))`} />
## 2
<MiniRepl tune={`sound "bd ~ <sd cp>"`} />
<MiniRepl tune={`sound("bd", silence, slowcat("sd", "cp"))`} />
<MiniRepl tune={`sound("bd ~ <sd cp>")
// sound('bd', silence, slowcat('sd', 'cp'))`} />
## 3
<MiniRepl tune={`sound "bd {cp sd, lt mt ht}"`} />
<MiniRepl tune={`sound("bd", pm(["cp", "sd"], ["lt", "mt", "ht"]))`} />
<MiniRepl tune={`?`} />
## 4
<MiniRepl tune={`sound "bd {cp sd, [lt mt,bd bd bd] ht}"`} />
<MiniRepl tune={` sound("bd", pm(["cp", "sd"],
[pr(["lt", "mt"],
["bd", "bd", "bd"]
),
"ht" ]))`} />
<MiniRepl tune={`??`} />
## 5
<MiniRepl tune={`sound "bd sd cp" # speed "1 2"`} />
<MiniRepl tune={`sound("bd", "sd", "cp") >> speed (1, 2)`} />
<MiniRepl tune={`sound("bd sd cp").speed("1 2")`} />
(operator overloading like in vortex?)
## 6
<MiniRepl tune={`rev $ sound "bd sd"`} />
<MiniRepl tune={`rev(sound("bd", "sd"))
sound("bd", "sd").rev()`} />
<MiniRepl tune={`rev(sound("bd sd"))
sound("bd sd").rev()`} />
## 7
<MiniRepl tune={`jux rev $ every 3 (fast 2) $ sound "bd sd"`} />
<MiniRepl tune={`jux(rev, every(3, fast(2), sound("bd", "sd")))
sound("bd","sd").every(3, fast(2)).jux(rev)`} />
<MiniRepl tune={`jux(rev, every(3, fast(2), sound("bd sd")))
sound("bd sd").every(3, fast(2)).jux(rev)`} />
(partial application)
## 8
<MiniRepl tune={`n ("1 2 3" + "4 5") # sound "drum"`} />
<MiniRepl tune={`n (sequence(1,2,3) + sequence(4,5)) >> sound "drum"`} />
<MiniRepl tune={`n("1 2 3".add("4 5")).sound("drum")
n("5 [6 7] 8").sound("drum")`} />
(operator overloading?)
## 9
<MiniRepl tune={`speed("1 2 3" + sine)`} />
<MiniRepl tune={`speed(sequence(1,2,3) + sine)`} />
<MiniRepl tune={`speed("1 2 3".add(sine))
"c3*4".add(sine.mul(12).slow(8)).pianoroll()`} />
## 10
- Mininotation
# Strudel/web specifics
@ -118,6 +275,55 @@ or whether javascript affordances mean it's going its own way..
- emulating musician thought patterns
- microtonal features? webserial
## User Code Transpilation
(compare user input vs shifted output)
### double quotes -\> mini calls
<MiniRepl tune={`"c3 e3" // or `c3 e3``} />
<MiniRepl tune={`mini("c3 e3")`} />
### operator overloading
<MiniRepl tune={`cat(c3, e3) * 4`} />
<MiniRepl tune={`reify(cat("c3","e3")).fast(4)`} />
(reify is redundant here, the shapeshifter could have an additional
check...)
(TBD: ability to multiply mini notation strings)
### pseudo variables
<MiniRepl tune={`cat(c3, r, e3)`} />
<MiniRepl tune={`cat("c3",silence,"e3")`} />
### locations
<MiniRepl tune={`cat(c3, e3)`} />
<MiniRepl tune={`cat(
reify("c3").withLocation([1,4,4],[1,6,6]),
reify("e3").withLocation([1,8,8],[1,10,10])
)`} />
<MiniRepl tune={`mini("c3 e3")`} />
with locations:
<MiniRepl tune={`// "c3 e3"
mini("c3 e3").withMiniLocation([1,0,0],[1,7,7])`} />
(talk about mini adding locations of mini notation parser)
### top level await
<MiniRepl tune={`const p = (await piano()).toDestination()
cat(c3).tone(p)`} />
<MiniRepl tune={`(async()=>{
const p = (await piano()).toDestination();
return cat("c3").tone(p);
})()`} />
# Musical examples
...
@ -128,4 +334,16 @@ or whether javascript affordances mean it's going its own way..
- OSC -\> Supercollider
- mininotation as the 'regex' of metre
That
@https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode_x61_rpdm20
are excellent, I reference their work at least twice per sentence
[@https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode_x61_rpdm20,
p. 3]. Another reference [@https://zenodo.org/record/5788732].
<MiniRepl tune={`"1 2 3"`} />
# References
- gibber
- krill
- glicol

View File

@ -1,31 +1,225 @@
---
title: 'Strudel'
title: 'StrudelCycles: live coding algorithmic patterns on the web'
date: '2022-03-22'
url2cite: all-links
---
# Introduction
That @roberts2016 are excellent, I reference their work at least twice per sentence [@roberts2016, p. 3]. Another reference [@mclean21].
```javascript
"1 2 3"
```
This paper introduces Strudel, an alternative implementation of the TidalCycles live coding system, using the JavaScript programming language.
# Background
TidalCycles (or *Tidal* for short) has been developed since around 2009, as a system for live coding algorithmic patterns, particularly in music [@tidalcycles]. Tidal is embedded in the pure functional *Haskell* programming language, taking advantage of its terse syntax and advanced type system. Over the past decade, Tidal has undergone a number of re-writes, developing a functional reactive representation of pattern, where patterns may be combined and transformed in a wide variety of ways [@alternate-timelines]. Over this time is has gained diverse ideas from other patterned forms, including from computer music [@spiegel], Indian classical music [@bel], textiles [@fabricating], improvised percussion [@hession], and Ancient Greek lyric [@cyclic-patterns].
Most recently, attention has turned to transferring Tidal's ideas to other, less 'pure' languages; firstly, to the Python programming language as *TidalVortex* [@tidalvortex] (*Vortex* for short), and now to JavaScript as StrudelCycles (*Strudel* for short), the topic of the present paper. For general background on the motivations for porting Tidal to a multi-paradigm programming language, please see the TidalVortex paper [@tidalvortex]. The motivations for porting it to JavaScript are similar, with a particular slanting on accessibility - of course, a web browser based application does not require any installation. As with Vortex though, it is important to point out that this is a creative, free/open source project, and as such, an primary motivation will always be developer's curiosity, and market-driven perspectives on development choices may even be demotivational.
General motivations / related work.
Reference vortex paper and summarise its background.
# Introducing TidalStrudel
The reimplementation of TidalCycles in Python (cite TidalVortex) showed that it is possible to translate pure functional reactive programming ideas to a multi paradigm language. It proved to be a stepping stone to move to other multi-paradigm languages, like JavaScript. A significant part of of the Python codebase could be quickly ported to JavaScript by syntactical adjustments.
(do we want to call it TidalStrudel once, and Strudel for short from then on as with vortex? Or just stick with Strudel? Should we start calling TidalCycles just Cycles??)
# Introducing Strudel
* Motivating musical example
# Tidal patterns
(should we explain shortly what tidal patterns do in general here?)
The essence of TidalCycles are Patterns. Patterns are abstract entities that represent flows of time, supporting both continuous changes (like signals) and discrete events (like notes).
Taking a time span as its input, a Pattern can output a set of events that happen within that time span.
It depends on the structure of the Pattern where the events are placed.
From now on, this process of generating events from a time span will be called **querying**.
Example:
```js
const pattern = sequence(c3, [e3, g3]);
const events = pattern.query(0, 1);
console.log(events.map(e => e.show()))
```
In this example, we create a pattern using the `sequence` function and **query** it for the timespan from `0` to `1`.
Those numbers represent units of time called **cycles**. The length of one cycle defaults to one second, but could be any number of seconds.
The console output looks like this:
```js
(0 -> 1/2 c3)
(1/2 -> 3/4 e3)
(3/2 -> 1 g3)
```
In this output, each line represents one event. The two fractions represent the begin and end time of the event, followed by its value.
In this case, the events are placed in sequential order, where c3 takes the first half, and e3 and g3 together take the second half.
This temporal placement is the result of the `sequence` function, which divides its arguments equally over one cycle.
If an argument is an array, the same rule applies to that part of the sequence. In our example e3 and g3 are divided equally over the second half of the whole sequence.
# Mini Notation
In this example, the Pattern is created using the `mini` function, which parses Tidal's Mini Notation.
The Mini Notation is a Domain Specific Language (DSL) that allows expressing rhythms in a short mannger.
* Some comparisons of -Strudel with -Vortex and -Cycles code?
(the following examples are from vortex paper, with added js versions)
## 1
```haskell
sound "bd ~ [sd cp]"
```
```python
sound("bd", silence, ["sd", "cp"])
```
```javascript
sound("bd ~ [sd cp]")
```
without mini notation:
```haskell
sound $ cat
[pure "bd", silence,
cat(pure "sd", pure "cp")]
```
```javascript
sound('bd', silence, cat('sd', 'cp'))
```
## 2
```haskell
sound "bd ~ <sd cp>"
```
```python
sound("bd", silence, slowcat("sd", "cp"))
```
```javascript
sound("bd ~ <sd cp>")
// sound('bd', silence, slowcat('sd', 'cp'))
```
## 3
```haskell
sound "bd {cp sd, lt mt ht}"
```
```python
sound("bd", pm(["cp", "sd"], ["lt", "mt", "ht"]))
```
```js
?
```
## 4
```haskell
sound "bd {cp sd, [lt mt,bd bd bd] ht}"
```
```python
sound("bd", pm(["cp", "sd"],
[pr(["lt", "mt"],
["bd", "bd", "bd"]
),
"ht" ]))
```
```js
??
```
## 5
```haskell
sound "bd sd cp" # speed "1 2"
```
```python
sound("bd", "sd", "cp") >> speed (1, 2)
```
```javascript
sound("bd sd cp").speed("1 2")
```
(operator overloading like in vortex?)
## 6
```haskell
rev $ sound "bd sd"
```
```python
rev(sound("bd", "sd"))
sound("bd", "sd").rev()
```
```javascript
rev(sound("bd sd"))
sound("bd sd").rev()
```
## 7
```haskell
jux rev $ every 3 (fast 2) $ sound "bd sd"
```
```python
jux(rev, every(3, fast(2), sound("bd", "sd")))
sound("bd","sd").every(3, fast(2)).jux(rev)
```
```js
jux(rev, every(3, fast(2), sound("bd sd")))
sound("bd sd").every(3, fast(2)).jux(rev)
```
(partial application)
## 8
```haskell
n ("1 2 3" + "4 5") # sound "drum"
```
```python
n (sequence(1,2,3) + sequence(4,5)) >> sound "drum"
```
```js
n("1 2 3".add("4 5")).sound("drum")
n("5 [6 7] 8").sound("drum")
```
(operator overloading?)
## 9
```haskell
speed("1 2 3" + sine)
```
```python
speed(sequence(1,2,3) + sine)
```
```js
speed("1 2 3".add(sine))
"c3*4".add(sine.mul(12).slow(8)).pianoroll()
```
## 10
* Mininotation
# Strudel/web specifics
@ -46,7 +240,85 @@ adding source locations
* microtonal features?
webserial
# Musical examples
## User Code Transpilation
(compare user input vs shifted output)
### double quotes -> mini calls
```javascript
"c3 e3" // or `c3 e3`
```
```javascript
mini("c3 e3")
```
### operator overloading
```javascript
cat(c3, e3) * 4
```
```javascript
reify(cat("c3","e3")).fast(4)
```
(reify is redundant here, the shapeshifter could have an additional check...)
(TBD: ability to multiply mini notation strings)
### pseudo variables
```javascript
cat(c3, r, e3)
```
```javascript
cat("c3",silence,"e3")
```
### locations
```javascript
cat(c3, e3)
```
```javascript
cat(
reify("c3").withLocation([1,4,4],[1,6,6]),
reify("e3").withLocation([1,8,8],[1,10,10])
)
```
```javascript
mini("c3 e3")
```
with locations:
```javascript
// "c3 e3"
mini("c3 e3").withMiniLocation([1,0,0],[1,7,7])
```
(talk about mini adding locations of mini notation parser)
### top level await
```javascript
const p = (await piano()).toDestination()
cat(c3).tone(p)
```
```javascript
(async()=>{
const p = (await piano()).toDestination();
return cat("c3").tone(p);
})()
```
# Musical examples
...
@ -56,7 +328,27 @@ webserial
* OSC -> Supercollider
* mininotation as the 'regex' of metre
That @roberts2016 are excellent, I reference their work at least twice per sentence [@roberts2016, p. 3].
```javascript
"1 2 3"
```
# References
[@roberts2016]: https://www.tandfonline.com/doi/abs/10.1080/14794713.2016.1227602?journalCode=rpdm20
[@mclean21]: https://zenodo.org/record/5788732
[@alternate-timelines]: https://zenodo.org/record/5788732
[@tidal.pegjs]: https://www.semanticscholar.org/paper/Bringing-the-TidalCycles-Mini-Notation-to-the-Roberts/74965efadd572ae3f40d14c633a5c8581c1b9f42
[@tidalvortex]: https://zenodo.org/record/6456380
[@ogborn17]: https://www.semanticscholar.org/paper/Estuary%3A-Browser-based-Collaborative-Projectional-Ogborn-Beverley/c6b5d34575d6230dfd8751ca4af8e5f6e44d916b
[@tidalcycles]: https://dl.acm.org/doi/10.1145/2633638.2633647
[@hession]: https://www.scopus.com/record/display.uri?eid=2-s2.0-84907386880&origin=inward&txGid=03307e26fba02a27bdc68bda462016f6266316467_Extending_Instruments_with_Live_Algorithms_in_a_Percussion_Code_Duo
[@spiegel]: https://www.academia.edu/664807/Manipulations_of_musical_patterns
[@bel]: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.517.7129
[@algorithmicpattern]: https://zenodo.org/record/4299661
[@fabricating]: https://zenodo.org/record/2155745
[@cyclic-patterns]: https://zenodo.org/record/1548969
- gibber
- krill
- glicol

Binary file not shown.

View File

@ -1,7 +1,11 @@
\documentclass{tex/sig-alternate}
\usepackage{hyperref}
\usepackage[colorlinks = true,
linkcolor = blue,
urlcolor = blue,
citecolor = blue,
anchorcolor = blue]{hyperref}
\usepackage{fancyvrb}
\usepackage{xcolor}
@ -79,35 +83,42 @@
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\begin{document}
\setcopyright{waclicense}
\conferenceinfo{Web Audio Conference WAC-2022,}{December 6--8, 2022, Cannes, France.}
\conferenceinfo{Web Audio Conference WAC-2022,}{July 6--8, 2022, Cannes, France.}
\CopyrightYear{2022}
\title{Strudel}
\title{Strudel: Algorithmic Patterns for the Web}
\numberofauthors{2}
\author{
\alignauthor
\name{Felix Roos}
\affaddr{Affiliation?}
\email{x@x.com}
\affaddr{Lembach, France}
\email{flix91@gmail.com}
% 2nd. author
\alignauthor
\name{Alex McLean}
\affaddr{Then Try This\\ Sheffield/Penryn}
\affaddr{Then Try This\\ Sheffield/Penryn, UK}
\email{alex@slab.org}
}
\maketitle
\begin{sloppypar}
\begin{abstract}
Abstract goes here (find me in the latex template)
\end{abstract}
%\begin{abstract}
%Abstract goes here (find me in the latex template)
%\end{abstract}
\end{sloppypar}
$body$

View File

@ -94,10 +94,10 @@
\or % acmcopyright
ACM.
\or % acmlicensed
Copyright held by the owner/author(s). Publication rights licensed to
Copyright held by the owner/author(s). Publication rights not licensed to
ACM.
\or % rightsretained
Copyright held by the owner/author(s).
Felix Roos and Alex McLean.
\or % usgov
\or % usgovmixed
ACM.
@ -115,7 +115,7 @@
ACM.
\or % licensedothergov
\or % waclicense
Copyright held by the owner/author(s).
Felix Roos and Alex McLean.
\fi}
\def\@copyrightpermission{%
\ifcase\acm@copyrightmode\relax % none
@ -222,7 +222,7 @@
only.
\or % waclicense
\frame{\includegraphics[scale=.54]{images/cc}}\vspace{1mm}\vfill
Licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0). \textbf{Attribution}: owner/author(s).
Licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0). \textbf{Attribution}: Felix Roos and Alex McLean.
\fi}
\endinput
%%