mark tone + webdirt deprecated

+ add superdirt param list
This commit is contained in:
Felix Roos 2022-09-17 23:35:35 +02:00
parent dfd33bab8e
commit e4913dfb73

View File

@ -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:
<MiniRepl tune={`"c2 c3".fast(2).transpose("<0 -2 5 3>".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:
<MiniRepl tune={`"c2 c3".fast(2).transpose("<1P -2M 4P 3m>".slow(2)).transpose(1)`} />
### scale(name)
Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranpose.
<MiniRepl
tune={`"0 2 4 6 4 2"
.scale(seq('C2 major', 'C2 minor').slow(2))`}
/>
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:
<MiniRepl
tune={`"-8 [2,4,6]"
.scale('C4 bebop major')
.scaleTranspose("<0 -1 -2 -3 -4 -5 -6 -4>")`}
/>
### voicings(range?)
Turns chord symbols into voicings, using the smoothest voice leading possible:
<MiniRepl tune={`stack("<C^7 A7 Dm7 G7>".voicings(), "<C3 A2 D3 G2>")`} />
<!-- TODO: use voicing collection as first param + patternify. -->
### rootNotes(octave = 2)
Turns chord symbols into root notes of chords in given octave.
<MiniRepl tune={`"<C^7 A7b13 Dm7 G7>".rootNotes(3)`} />
Together with layer, struct and voicings, this can be used to create a basic backing track:
<MiniRepl
tune={`"<C^7 A7b13 Dm7 G7>".layer(
x => x.voicings(['d3','g4']).struct("~ x"),
x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out()))
)`}
/>
<!-- TODO: use range instead of octave. -->
<!-- TODO: find out why composition does not work -->
## 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.
<!--<MiniRepl
tune={`stack("<C^7 A7 Dm7 G7>".voicings(), "<C3 A2 D3 G2>")
.midi()`}
/>-->
# 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:
<MiniRepl tune={`s("bd sd").osc()`} />
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 }}
<br />
<br />
# Tone API (deprecated)
The Tone API uses Tone.js instruments ands effects to create sounds.
<MiniRepl
tune={`stack(
@ -788,248 +963,3 @@ Helper to set the envelope of a Tone.js instrument. Intended to be used with Ton
tune={`"[c4 c4 bb3 c4] [~ g3 ~ g3] [c4 f4 e4 c4] ~".slow(4)
.tone(synth(adsr(0,.1,0,0)).chain(out()))`}
/>
## 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:
<MiniRepl tune={`"c2 c3".fast(2).transpose("<0 -2 5 3>".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:
<MiniRepl tune={`"c2 c3".fast(2).transpose("<1P -2M 4P 3m>".slow(2)).transpose(1)`} />
### scale(name)
Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranpose.
<MiniRepl
tune={`"0 2 4 6 4 2"
.scale(seq('C2 major', 'C2 minor').slow(2))`}
/>
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:
<MiniRepl
tune={`"-8 [2,4,6]"
.scale('C4 bebop major')
.scaleTranspose("<0 -1 -2 -3 -4 -5 -6 -4>")`}
/>
### voicings(range?)
Turns chord symbols into voicings, using the smoothest voice leading possible:
<MiniRepl tune={`stack("<C^7 A7 Dm7 G7>".voicings(), "<C3 A2 D3 G2>")`} />
<!-- TODO: use voicing collection as first param + patternify. -->
### rootNotes(octave = 2)
Turns chord symbols into root notes of chords in given octave.
<MiniRepl tune={`"<C^7 A7b13 Dm7 G7>".rootNotes(3)`} />
Together with layer, struct and voicings, this can be used to create a basic backing track:
<MiniRepl
tune={`"<C^7 A7b13 Dm7 G7>".layer(
x => x.voicings(['d3','g4']).struct("~ x"),
x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out()))
)`}
/>
<!-- TODO: use range instead of octave. -->
<!-- TODO: find out why composition does not work -->
## 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.
<!--<MiniRepl
tune={`stack("<C^7 A7 Dm7 G7>".voicings(), "<C3 A2 D3 G2>")
.midi()`}
/>-->
# 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/)
<br />
<br />
## 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:
<MiniRepl tune={`s("bd sd").osc()`} />
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 }}