From e4913dfb737b604803e43f07e027f726b37b6e3f Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sat, 17 Sep 2022 23:35:35 +0200 Subject: [PATCH] mark tone + webdirt deprecated + add superdirt param list --- tutorial/tutorial.mdx | 426 ++++++++++++++++++------------------------ 1 file changed, 178 insertions(+), 248 deletions(-) diff --git a/tutorial/tutorial.mdx b/tutorial/tutorial.mdx index 134ea978..09990cc2 100644 --- a/tutorial/tutorial.mdx +++ b/tutorial/tutorial.mdx @@ -647,11 +647,186 @@ These methods add random behavior to your Patterns. {{ 'Pattern.always' | jsdoc }} -## Tone API +# Tonal API -To make the sounds more interesting, we can use Tone.js instruments ands effects. +The Tonal API, uses [tonaljs](https://github.com/tonaljs/tonal) to provide helpers for musical operations. -[Show Source on Github](https://github.com/tidalcycles/strudel/blob/main/repl/src/tone.ts) +### transpose(semitones) + +Transposes all notes to the given number of semitones: + +".slow(2)).transpose(0)`} /> + +This method gets really exciting when we use it with a pattern as above. + +Instead of numbers, scientific interval notation can be used as well: + +".slow(2)).transpose(1)`} /> + +### scale(name) + +Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranpose. + + + +Note that the scale root is octaved here. You can also omit the octave, then index zero will default to octave 3. + +All the available scale names can be found [here](https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts). + +### scaleTranspose(steps) + +Transposes notes inside the scale by the number of steps: + +")`} +/> + +### voicings(range?) + +Turns chord symbols into voicings, using the smoothest voice leading possible: + +".voicings(), "")`} /> + + + +### rootNotes(octave = 2) + +Turns chord symbols into root notes of chords in given octave. + +".rootNotes(3)`} /> + +Together with layer, struct and voicings, this can be used to create a basic backing track: + +".layer( + x => x.voicings(['d3','g4']).struct("~ x"), + x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out())) +)`} +/> + + + + +## Microtonal API + +TODO + +## MIDI API + +Strudel also supports midi via [webmidi](https://npmjs.com/package/webmidi). + +### midi(outputName?) + +Make sure to have a midi device connected or to use an IAC Driver. +If no outputName is given, it uses the first midi output it finds. + +Midi is currently not supported by the mini repl used here, but you can [open the midi example in the repl](https://strudel.tidalcycles.org/#c3RhY2soIjxDXjcgQTcgRG03IEc3PiIubS52b2ljaW5ncygpLCAnPEMzIEEyIEQzIEcyPicubSkKICAubWlkaSgp). + +In the REPL, you will se a log of the available MIDI devices. + + + +# Superdirt API + +In mainline tidal, the actual sound is generated via Superdirt, which runs inside Supercollider. +Strudel also supports using Superdirt as a backend, although it requires some developer tooling to run. + +## Prequisites + +Getting Superdirt to work with Strudel, you need to + +1. install SuperCollider + sc3 plugins, see [Tidal Docs](https://tidalcycles.org/docs/) (Install Tidal) for more info. +2. install [node.js](https://nodejs.org/en/) +3. download [Strudel Repo](https://github.com/tidalcycles/strudel/) (or git clone, if you have git installed) +4. run `npm i` in the strudel directory +5. run `npm run osc` to start the osc server, which forwards OSC messages from Strudel REPL to SuperCollider + +Now you're all set! + +## Usage + +1. Start SuperCollider, either using SuperCollider IDE or by running `sclang` in a terminal +2. Open the [Strudel REPL](https://strudel.tidalcycles.org/#cygiYmQgc2QiKS5vc2MoKQ%3D%3D) + +...or test it here: + + + +If you now hear sound, congratulations! If not, you can get help on the [#strudel channel in the TidalCycles discord](https://discord.com/invite/HGEdXmRkzT). + +{{ 'Pattern.osc' | jsdoc }} + +## Superdirt Params + +The following functions can be used with superdirt: + +- s +- n +- freq +- channel +- orbit +- cutoff +- resonance +- hcutoff +- hresonance +- bandf +- bandq +- djf +- vowelSa +- cut +- begin +- end +- loop +- fadeTime +- speed +- unitA +- gain +- amp +- accelerate +- crush +- coarse +- delay +- lock +- leslie +- lrate +- lsize +- pan +- panspan +- pansplay +- room +- size +- dry +- shape +- squiz +- waveloss +- attack +- decayS +- octave +- detune +- tremolodepth + +Please refer to [Tidal Docs](https://tidalcycles.org/) for more info. + +# Webdirt API (deprecated) + +You can use the powerful sampling engine [Webdirt](https://github.com/dktr0/WebDirt) with Strudel. + +{{ 'Pattern.webdirt' | jsdoc }} + +
+
+ +# Tone API (deprecated) + +The Tone API uses Tone.js instruments ands effects to create sounds. - -## Tonal API - -The Tonal API, uses [tonaljs](https://github.com/tonaljs/tonal) to provide helpers for musical operations. - -### transpose(semitones) - -Transposes all notes to the given number of semitones: - -".slow(2)).transpose(0)`} /> - -This method gets really exciting when we use it with a pattern as above. - -Instead of numbers, scientific interval notation can be used as well: - -".slow(2)).transpose(1)`} /> - -### scale(name) - -Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranpose. - - - -Note that the scale root is octaved here. You can also omit the octave, then index zero will default to octave 3. - -All the available scale names can be found [here](https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts). - -### scaleTranspose(steps) - -Transposes notes inside the scale by the number of steps: - -")`} -/> - -### voicings(range?) - -Turns chord symbols into voicings, using the smoothest voice leading possible: - -".voicings(), "")`} /> - - - -### rootNotes(octave = 2) - -Turns chord symbols into root notes of chords in given octave. - -".rootNotes(3)`} /> - -Together with layer, struct and voicings, this can be used to create a basic backing track: - -".layer( - x => x.voicings(['d3','g4']).struct("~ x"), - x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out())) -)`} -/> - - - - -## Microtonal API - -TODO - -## MIDI API - -Strudel also supports midi via [webmidi](https://npmjs.com/package/webmidi). - -### midi(outputName?) - -Make sure to have a midi device connected or to use an IAC Driver. -If no outputName is given, it uses the first midi output it finds. - -Midi is currently not supported by the mini repl used here, but you can [open the midi example in the repl](https://strudel.tidalcycles.org/#c3RhY2soIjxDXjcgQTcgRG03IEc3PiIubS52b2ljaW5ncygpLCAnPEMzIEEyIEQzIEcyPicubSkKICAubWlkaSgp). - -In the REPL, you will se a log of the available MIDI devices. - - - -# Contributing - -Contributions of any sort are very welcome! You can contribute by editing [this file](https://github.com/tidalcycles/strudel/blob/main/repl/src/tutorial/tutorial.mdx). -All you need is a github account. - -If you want to run the tutorial locally, you can clone the and run: - -```sh -cd repl && npm i && npm run tutorial -``` - -If you want to contribute in another way, either - -- [fork strudel repo on GitHub](https://github.com/tidalcycles/strudel) -- [Join the Discord Channel](https://discord.gg/remJ6gQA) -- [play with the Strudel REPL](https://strudel.tidalcycles.org/) - -
-
- -## Using Samples with Webdirt - -You can use the powerful sampling engine [Webdirt](https://github.com/dktr0/WebDirt) with Strudel. - -{{ 'Pattern.webdirt' | jsdoc }} - -## Using Superdirt via OSC - -In mainline tidal, the actual sound is generated via Superdirt, which runs inside Supercollider. -Strudel also supports using Superdirt as a backend, although it requires some developer tooling to run. - -### Getting Started - -Getting Superdirt to work with Strudel, you need to - -1. install SuperCollider + sc3 plugins, see [Tidal Docs](https://tidalcycles.org/docs/) (Install Tidal) for more info. -2. install [node.js](https://nodejs.org/en/) -3. download [Strudel Repo](https://github.com/tidalcycles/strudel/) (or git clone, if you have git installed) -4. run `npm i` in the strudel directory -5. run `npm run osc` to start the osc server, which forwards OSC messages from Strudel REPL to SuperCollider - -Now you're all set! - -### Usage - -1. Start SuperCollider, either using SuperCollider IDE or by running `sclang` in a terminal -2. Open the [Strudel REPL](https://strudel.tidalcycles.org/#cygiYmQgc2QiKS5vc2MoKQ%3D%3D) - -...or test it here: - - - -If you now hear sound, congratulations! If not, you can get help on the [#strudel channel in the TidalCycles discord](https://discord.com/invite/HGEdXmRkzT). - -{{ 'Pattern.osc' | jsdoc }} - -# Superdirt Params - -The following functions are specific to SuperDirt and won't work with other Strudel outputs. - -## Basic Types - -{{ 's' | jsdoc }} - -{{ 'n' | jsdoc }} - -{{ 'freq' | jsdoc }} - -{{ 'channel' | jsdoc }} - -{{ 'orbit' | jsdoc }} - -## Filters - -{{ 'cutoff' | jsdoc }} - -{{ 'resonance' | jsdoc }} - -{{ 'hcutoff' | jsdoc }} - -{{ 'hresonance' | jsdoc }} - -{{ 'bandf' | jsdoc }} - -{{ 'bandq' | jsdoc }} - -{{ 'djf' | jsdoc }} - -{{ 'vowel' | jsdoc }} - -## Sample Editing - -{{ 'cut' | jsdoc }} - -{{ 'begin' | jsdoc }} - -{{ 'end' | jsdoc }} - -{{ 'loop' | jsdoc }} - -{{ 'fadeTime' | jsdoc }} - -{{ 'speed' | jsdoc }} - -{{ 'unit' | jsdoc }} - -## Audio Effects - -{{ 'gain' | jsdoc }} - -{{ 'amp' | jsdoc }} - -{{ 'accelerate' | jsdoc }} - -{{ 'crush' | jsdoc }} - -{{ 'coarse' | jsdoc }} - -{{ 'delay' | jsdoc }} - -{{ 'lock' | jsdoc }} - -{{ 'leslie' | jsdoc }} - -{{ 'lrate' | jsdoc }} - -{{ 'lsize' | jsdoc }} - -{{ 'pan' | jsdoc }} - -{{ 'panspan' | jsdoc }} - -{{ 'pansplay' | jsdoc }} - -{{ 'room' | jsdoc }} - -{{ 'size' | jsdoc }} - -{{ 'dry' | jsdoc }} - -{{ 'shape' | jsdoc }} - -{{ 'squiz' | jsdoc }} - -{{ 'waveloss' | jsdoc }} - -{{ 'attack' | jsdoc }} - -{{ 'decay' | jsdoc }} - -## Synth Effects - -{{ 'octave' | jsdoc }} - -{{ 'detune' | jsdoc }} - -{{ 'tremolodepth' | jsdoc }}