From 51a4c4d13bf377f3adff36fd70c21e67e25250c3 Mon Sep 17 00:00:00 2001 From: Jack Armitage Date: Mon, 26 Dec 2022 11:30:01 +0000 Subject: [PATCH] codeformat --- website/src/pages/learn/code.mdx | 15 ++++---- website/src/pages/learn/getting-started.mdx | 9 ++--- website/src/pages/learn/input-output.mdx | 2 +- website/src/pages/learn/mini-notation.mdx | 6 +-- website/src/pages/learn/notes.mdx | 15 +++++--- website/src/pages/learn/samples.mdx | 41 ++++++++++++++------- website/src/pages/learn/sounds.mdx | 7 ++-- website/src/pages/learn/synths.mdx | 5 ++- 8 files changed, 60 insertions(+), 40 deletions(-) diff --git a/website/src/pages/learn/code.mdx b/website/src/pages/learn/code.mdx index 470565df..03691686 100644 --- a/website/src/pages/learn/code.mdx +++ b/website/src/pages/learn/code.mdx @@ -9,7 +9,7 @@ import { JsDoc } from '../../docs/JsDoc'; # Strudel Code -Now that we have played some notes using different sounds, let's take a step back and look how we actually achieved this using _code_. +Now that we have played some notes using different sounds, let's take a step back and look how we actually achieved this using _code_. Let's look at this simple example again. What do we notice? @@ -43,7 +43,7 @@ So far, we've seen the following syntax: xxx("foo").yyy("bar") ``` -Generally, `xxx` and `yyy` are called [_functions_](https://en.wikipedia.org/wiki/Function_(computer_programming)), while `foo` and `bar` are called function [_arguments_ or _parameters_](https://en.wikipedia.org/wiki/Parameter_(computer_programming)). +Generally, `xxx` and `yyy` are called [_functions_](), while `foo` and `bar` are called function [_arguments_ or _parameters_](). So far, we've used the functions to declare which aspect of the sound we want to control, and their arguments for the actual data. The `yyy` function is called a [_chained_ function](https://en.wikipedia.org/wiki/Method_chaining), because it is appended with a dot (`.`). @@ -52,7 +52,8 @@ You can think of this as being similar to chaining audio effects together using Strudel makes heavy use of chained functions. Here is a more sophisticated example: -). A string is simply a sequence of individual characters. In TidalCycles, strings are used to write _patterns_ using the mini-notation, and you may hear the phrase _pattern string_ from time to time. @@ -78,4 +79,4 @@ The good news is, that this covers 99% of the JavaScript syntax needed for Strud Let's now look at the way we can express [Rhythms](/learn/mini-notation)... -
\ No newline at end of file +
diff --git a/website/src/pages/learn/getting-started.mdx b/website/src/pages/learn/getting-started.mdx index 6e718ab7..b6fefd5a 100644 --- a/website/src/pages/learn/getting-started.mdx +++ b/website/src/pages/learn/getting-started.mdx @@ -11,7 +11,6 @@ import { JsDoc } from '../../docs/JsDoc'; Welcome to the Strudel documentation pages! - These pages will introduce you to [Strudel](https://strudel.tidalcycles.org/), a web-based [live coding](https://github.com/toplap/awesome-livecoding/) environment that implements the [Tidal Cycles](https://tidalcycles.org) algorithmic pattern language. # What is Strudel? @@ -29,7 +28,7 @@ Strudel however runs directly in your web browser, does not require any custom s The main place to actually make music with Strudel is the [Strudel REPL](https://strudel.tidalcycles.org/) ([what is a REPL?](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)), but in these pages you will also encounter interactive "MiniREPLs" where you can listen to and edit Strudel patterns. Try clicking the play icon below: - + Then edit the text so it reads `s("bd sn cp hh")` and click the refresh icon. Congratulations, you have now live coded your first Strudel pattern! @@ -78,13 +77,13 @@ s("bd,[~ ],hh(3,4)") // drums # Strudel is a work in progress 🚧 -Please note that this project is still in its experimental state. +Please note that this project is still in its experimental state. In the future, parts of it might change significantly. -This tutorial is also far from complete. +This tutorial is also far from complete. You can contribute to it clicking 'Edit this page' in the top right, or by visiting the [Strudel GitHub page](https://github.com/tidalcycles/strudel/). # What's next? Head on over to the [Notes](/learn/notes) page. -
\ No newline at end of file +
diff --git a/website/src/pages/learn/input-output.mdx b/website/src/pages/learn/input-output.mdx index 27ae5ef7..b7766719 100644 --- a/website/src/pages/learn/input-output.mdx +++ b/website/src/pages/learn/input-output.mdx @@ -69,4 +69,4 @@ The following functions can be used with [SuperDirt](https://github.com/musikinf Please refer to [Tidal Docs](https://tidalcycles.org/) for more info. -
\ No newline at end of file +
diff --git a/website/src/pages/learn/mini-notation.mdx b/website/src/pages/learn/mini-notation.mdx index 8690f844..877c6fad 100644 --- a/website/src/pages/learn/mini-notation.mdx +++ b/website/src/pages/learn/mini-notation.mdx @@ -200,7 +200,7 @@ Let's look at those three parameters in detail. ## Beats -`beats`: the first parameter controls how may beats will be played. +`beats`: the first parameter controls how may beats will be played. Compare these: @@ -217,7 +217,7 @@ Compare these: ## Offsets -`offset`: the third (optional) parameter controls the starting position for distributing the beats. +`offset`: the third (optional) parameter controls the starting position for distributing the beats. We need a secondary rhythm to hear the difference: @@ -232,4 +232,4 @@ Starting with this one `n`, can you make a _pattern string_ that uses every sing -
+
diff --git a/website/src/pages/learn/notes.mdx b/website/src/pages/learn/notes.mdx index 6d711d98..d8b495a2 100644 --- a/website/src/pages/learn/notes.mdx +++ b/website/src/pages/learn/notes.mdx @@ -14,13 +14,18 @@ In Strudel, there are three different ways to express a pitch, `note`, `n` and ` Here's the same pattern written in three different ways: - `note`: letter notation, good for those who are familiar with western music theory: - + + {' '} + - `n`: number notation, good for those who want to use recognisable pitches, but don't care about music theory: - + + {' '} + - `freq`: frequency notation, good for those who want to go beyond standardised tuning systems: - + {' '} + Let's look at `note`, `n` and `freq` in more detail... @@ -81,8 +86,8 @@ In this page, when we played a pattern of notes like this: We heard a simple synthesised sound, in fact we heard a [square wave oscillator](https://en.wikipedia.org/wiki/Square_wave). -This is the default synthesiser used by Strudel, but how do we then make different sounds in Strudel? +This is the default synthesiser used by Strudel, but how do we then make different sounds in Strudel? Let's find out in the next page on [Sounds](/learn/sounds). -
\ No newline at end of file +
diff --git a/website/src/pages/learn/samples.mdx b/website/src/pages/learn/samples.mdx index bedcebba..7804ffe8 100644 --- a/website/src/pages/learn/samples.mdx +++ b/website/src/pages/learn/samples.mdx @@ -23,7 +23,8 @@ To know which sounds are available, open the [default sample map](https://strude You can load your own sample map using the `samples` function. In this example we create a map using sounds from the default sample map: -,~ ,[hh:0 hh:1]*2")`} The `:0` `:1` etc. are the indices of the array. The sample number can also be set using `n`: -")`} In that case, we might load our guitar sample map a different way: -").s("guitar")`} For pitched sounds, you can use `note`, just like with synths: -@2").s('gtr').gain(.5)`} Here, the guitar samples will overlap, because they always play till the end. If we want them to behave more like a synth, we can add `clip(1)`: -@2").s('gtr').clip(1) If we have 2 samples with different base pitches, we can make them in tune by specifying the pitch like this: - -
\ No newline at end of file +
diff --git a/website/src/pages/learn/sounds.mdx b/website/src/pages/learn/sounds.mdx index cd1f4751..4e944581 100644 --- a/website/src/pages/learn/sounds.mdx +++ b/website/src/pages/learn/sounds.mdx @@ -10,10 +10,11 @@ import { JsDoc } from '../../docs/JsDoc'; # Sounds We can play sounds with `s`, in two different ways: + - `s` can trigger audio samples, where a sound file is loaded in the background and played back: - + - `s` can trigger audio synthesisers, which are synthesised in real-time using code also running in the background: - + You can learn more about both of these approaches in the pages [Synths](/learn/synths) and [Samples](/learn/samples). @@ -37,4 +38,4 @@ Hmm, something interesting is going on there, related to there being five notes Let's now take a step back and think about the Strudel [Code](/learn/code) we've been hearing so far. -
\ No newline at end of file +
diff --git a/website/src/pages/learn/synths.mdx b/website/src/pages/learn/synths.mdx index d7ca747c..f11388de 100644 --- a/website/src/pages/learn/synths.mdx +++ b/website/src/pages/learn/synths.mdx @@ -34,8 +34,9 @@ Now we not only pattern the notes, but the sound as well! You can control the envelope of a synth using the `attack`, `decay`, `sustain` and `release` functions: >").s('sawtooth') + client:idle + tune={`note("c2 >").s('sawtooth') .attack(.1).decay(.1).sustain(.2).release(.1)`} /> -
\ No newline at end of file +