mirror of
https://codeberg.org/uzu/strudel
synced 2026-11-23 01:01:55 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 24ac74e0ca |
@@ -1,23 +0,0 @@
|
||||
In line with [our humane policy](POLICY.md), code and documentation
|
||||
should not be written by LLM agents. To this end, agents should not
|
||||
edit the codebase or make any commits that are intended to be
|
||||
contributed upstream. Likewise, LLM output should not be pasted into
|
||||
issues, comments, pull requests and so on.
|
||||
|
||||
A contributor's personal use of LLMs and related technology is their
|
||||
own business, whether for research, analysis, bug discovery or other
|
||||
assistive technology, so long as the output is not included in any
|
||||
contributions to our projects.
|
||||
|
||||
Strudel is AGPL licensed, and so any code integrated with it also
|
||||
comes under that license. This should be carefully considered before
|
||||
distributing software integrated with strudel, including making it
|
||||
available over a network.
|
||||
|
||||
Strudel has purposefully moved away from github.com, as a closed
|
||||
source platform with ethical issues. Please do not fork strudel back
|
||||
to that platform, or similar corporate platforms.
|
||||
|
||||
Projects using strudel must not use "strudel" in their name, unless
|
||||
they are 'official' projects, or have the blessing of the strudel
|
||||
community.
|
||||
@@ -41,8 +41,6 @@ Licensing info for the default sound banks can be found over on the [dough-sampl
|
||||
|
||||
There are many ways to contribute to this project! See [contribution guide](./CONTRIBUTING.md). You can find the full list of contributors [here](https://codeberg.org/uzu/strudel/activity/contributors).
|
||||
|
||||
Please see [POLICY.md](POLICY.md) for our code of conduct and humane AI/LLM policy.
|
||||
|
||||
## Community
|
||||
|
||||
Strudel is a member of the 'Uzu' family of pattern-based live coding languages, along with TidalCycles and friends.
|
||||
|
||||
@@ -104,32 +104,6 @@ function getCanvasWidget(id, options = {}) {
|
||||
return canvas;
|
||||
}
|
||||
|
||||
function getListWidget(id, options = {}) {
|
||||
const { width = 600, height = 100 } = options;
|
||||
let el = document.getElementById(id) || document.createElement('div');
|
||||
el.style.width = width + 'px';
|
||||
el.style.height = height + 'px';
|
||||
el.style.overflowY = 'auto';
|
||||
el.style.overflowX = 'auto';
|
||||
el.style.boxSizing = 'border-box';
|
||||
el.style.padding = '4px';
|
||||
el.style.fontFamily = 'monospace';
|
||||
el.style.lineHeight = '1.4';
|
||||
el.style.whiteSpace = 'pre';
|
||||
el.style.background = 'var(--background)';
|
||||
el.style.color = 'var(--foreground)';
|
||||
el.style.border = '1px solid var(--lineHighlight)';
|
||||
// reset on every (re-)evaluation instead of persisting scroll state across it
|
||||
el.replaceChildren();
|
||||
el.scrollTop = 0;
|
||||
el.follow = true;
|
||||
el.onscroll = () => {
|
||||
el.follow = el.scrollHeight - el.scrollTop - el.clientHeight < 4;
|
||||
};
|
||||
setWidget(id, el);
|
||||
return el;
|
||||
}
|
||||
|
||||
registerWidget('_pianoroll', (id, options = {}, pat) => {
|
||||
const ctx = getCanvasWidget(id, options).getContext('2d');
|
||||
return pat.tag(id).pianoroll({ fold: 1, ...options, ctx, id });
|
||||
@@ -166,9 +140,3 @@ registerWidget('_spectrum', (id, options = {}, pat) => {
|
||||
const ctx = getCanvasWidget(id, options).getContext('2d');
|
||||
return pat.spectrum({ ...options, ctx, id });
|
||||
});
|
||||
|
||||
registerWidget('_print', (id, options = {}, pat) => {
|
||||
options = { width: 600, height: 100, maxLines: 500, ...options };
|
||||
const el = getListWidget(id, options);
|
||||
return pat.print({ ...options, el, id });
|
||||
});
|
||||
|
||||
@@ -73,15 +73,6 @@ export function registerControl(names, ...aliases) {
|
||||
return bag;
|
||||
}
|
||||
|
||||
// Constructs a superdirt effect bus control
|
||||
const sdbus = register('sdbus', function (busid, control_name, busval, pat) {
|
||||
return pat[control_name]('c' + busid).withValue((val) => {
|
||||
const newval = { ...val };
|
||||
newval['^' + control_name] = [busid, busval];
|
||||
return newval;
|
||||
});
|
||||
});
|
||||
|
||||
export function registerMultiControl(names, maxControls, ...aliases) {
|
||||
names = Array.isArray(names) ? names : [names];
|
||||
let bag = {};
|
||||
@@ -2711,7 +2702,32 @@ export const { seconds } = registerControl('seconds');
|
||||
export const { songPtr } = registerControl('songPtr');
|
||||
export const { uid } = registerControl('uid');
|
||||
export const { val } = registerControl('val');
|
||||
|
||||
/**
|
||||
* Plays the pattern at the given cycles per second. The cps can be patterned. This changes the global tempo, so it generally
|
||||
* makes sense to have either `cps` (or `cpm` - cycles per minute) set by only one of your patterns.
|
||||
* Note that this currently does not work when the 'Sync across Browser Tabs / Windows' setting is switched on.
|
||||
* @tags temporal
|
||||
* @example
|
||||
* s("bd hh sd hh").cps(0.5) // = 1 cycle every 2 seconds
|
||||
* @example
|
||||
* // a smooth change over 4 cycles
|
||||
* s("bd hh sd hh").cps(sine.slow(4).range(0.5,1.5))
|
||||
*/
|
||||
export const { cps } = registerControl('cps');
|
||||
|
||||
/**
|
||||
* Plays the pattern at the given cycles per minute. The cpm can be patterned. This changes the global tempo, so it generally
|
||||
* makes sense to have either `cpm` (or `cps` - cycles per second) set by only one of your patterns.
|
||||
* Note that this currently does not work when the 'Sync across Browser Tabs / Windows' setting is switched on.
|
||||
* @tags temporal
|
||||
* @example
|
||||
* s("bd hh sd hh").cpm(90) // = feels like 180 bpm
|
||||
* // a smooth change over 4 cycles
|
||||
* s("bd hh sd hh").cpm(sine.slow(4).range(30,70))
|
||||
*/
|
||||
export const { cpm } = registerControl('cpm');
|
||||
|
||||
/**
|
||||
* Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration.
|
||||
*
|
||||
|
||||
+13
-11
@@ -74,20 +74,20 @@ export class Cyclist {
|
||||
// query the pattern for events
|
||||
const haps = this.pattern
|
||||
.queryArc(begin, end, { _cps: this.cps, cyclist: 'cyclist' })
|
||||
.filter((hap) => hap.hasOnset() || hap.context.processParts)
|
||||
.filter((hap) => hap.hasOnset())
|
||||
// Sort the haps based on their onset, so cps changes within the
|
||||
// tick duration happen in the correct order.
|
||||
.sort((a, b) => {
|
||||
const aBegin = a.part.begin;
|
||||
const bBegin = b.part.begin;
|
||||
const aBegin = a.whole.begin;
|
||||
const bBegin = b.whole.begin;
|
||||
// If haps happen at the same time, trigger the haps that cause
|
||||
// cps changes first, so the durations of the simultaneous haps
|
||||
// are adjusted accordingly.
|
||||
if (aBegin.eq(bBegin)) {
|
||||
if (a.value.cps !== undefined) {
|
||||
return b.value.cps !== undefined ? 0 : -1;
|
||||
if (a.value.cps !== undefined || a.value.cpm !== undefined) {
|
||||
return b.value.cps !== undefined || b.value.cpm !== undefined ? 0 : -1;
|
||||
}
|
||||
if (b.value.cps !== undefined) {
|
||||
if (b.value.cps !== undefined || b.value.cpm !== undefined) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -96,7 +96,9 @@ export class Cyclist {
|
||||
});
|
||||
|
||||
haps.forEach((hap) => {
|
||||
const targetTime = (hap.part.begin - this.checkpoint.cycles) / this.cps + this.checkpoint.seconds;
|
||||
const targetTime = (hap.whole.begin - this.checkpoint.cycles) / this.cps + this.checkpoint.seconds;
|
||||
let hapCps = hap.value.cps;
|
||||
hapCps ??= hap.value.cpm != null ? hap.value.cpm / 60 : undefined;
|
||||
if (tickEndTime < targetTime) {
|
||||
// If the targetTime exceeds the tickEndTime, this means
|
||||
// the cps has slowed down, and the latter haps from the query
|
||||
@@ -104,13 +106,13 @@ export class Cyclist {
|
||||
// They'll be scheduled during the next tick.
|
||||
return;
|
||||
}
|
||||
onSchedule?.(hap, targetTime + this.latency, hap.value.cps ?? this.cps);
|
||||
if (hap.value.cps !== undefined && this.cps != hap.value.cps) {
|
||||
onSchedule?.(hap, targetTime + this.latency, hapCps ?? this.cps);
|
||||
if (hapCps !== undefined && this.cps != hapCps) {
|
||||
cpsChanged = true;
|
||||
this.cps = hap.value.cps;
|
||||
this.cps = hapCps;
|
||||
this.num_ticks_since_checkpoint = 0;
|
||||
this.checkpoint = {
|
||||
cycles: hap.part.begin,
|
||||
cycles: hap.whole.begin,
|
||||
seconds: targetTime,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class Hap {
|
||||
then the whole will be returned as None, in which case the given
|
||||
value will have been sampled from the point halfway between the
|
||||
start and end of the 'part' timespan.
|
||||
The context is to store metadata, including a list of source code locations causing the event.
|
||||
The context is to store a list of source code locations causing the event.
|
||||
|
||||
The word 'Event' is more or less a reserved word in javascript, hence this
|
||||
class is named called 'Hap'.
|
||||
@@ -161,10 +161,6 @@ export class Hap {
|
||||
return new Hap(this.whole, this.part, this.value, context);
|
||||
}
|
||||
|
||||
withContext(f) {
|
||||
return new Hap(this.whole, this.part, this.value, f(this.context));
|
||||
}
|
||||
|
||||
ensureObjectValue() {
|
||||
/* if (isNote(hap.value)) {
|
||||
// supports primitive hap values that look like notes
|
||||
|
||||
@@ -64,12 +64,7 @@ export class Pattern {
|
||||
this.__steps = steps === undefined ? undefined : Fraction(steps);
|
||||
}
|
||||
|
||||
_processParts() {
|
||||
return this.withHap((hap) => hap.withContext((c) => ({ ...c, processParts: true })));
|
||||
}
|
||||
|
||||
setSteps(steps) {
|
||||
// TODO shouldn't this be pure and return a new pattern?
|
||||
this._steps = steps;
|
||||
return this;
|
||||
}
|
||||
@@ -2481,18 +2476,6 @@ export const apply = register('apply', function (func, pat) {
|
||||
return func(pat);
|
||||
});
|
||||
|
||||
/**
|
||||
* Plays the pattern at the given cycles per minute.
|
||||
* @tags temporal
|
||||
* @deprecated
|
||||
* @example
|
||||
* s("<bd sd>,hh*2").cpm(90) // = 90 bpm
|
||||
*/
|
||||
// this is redefined in repl.mjs, using the current cps as divisor
|
||||
export const cpm = register('cpm', function (cpm, pat) {
|
||||
return pat._fast(cpm / 60 / 1);
|
||||
});
|
||||
|
||||
/**
|
||||
* Nudge a pattern to start earlier in time. Equivalent of Tidal's <~ operator
|
||||
*
|
||||
|
||||
@@ -217,14 +217,10 @@ export function repl({
|
||||
} catch (err) {
|
||||
console.warn('injectPatternMethods: error:', err);
|
||||
}
|
||||
const cpm = register('cpm', function (cpm, pat) {
|
||||
return pat._fast(cpm / 60 / scheduler.cps);
|
||||
});
|
||||
return evalScope({
|
||||
all,
|
||||
each,
|
||||
hush,
|
||||
cpm,
|
||||
setCps,
|
||||
setcps: setCps,
|
||||
setCpm,
|
||||
|
||||
@@ -4,4 +4,3 @@ export * from './draw.mjs';
|
||||
export * from './pianoroll.mjs';
|
||||
export * from './spiral.mjs';
|
||||
export * from './pitchwheel.mjs';
|
||||
export * from './print.mjs';
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
print.mjs - prints hap values to the console or a scrollable inline widget
|
||||
Copyright (C) 2022 Strudel contributors - see
|
||||
<https://codeberg.org/uzu/strudel/src/branch/main/packages/draw/print.mjs> This
|
||||
program is free software: you can redistribute it and/or modify it under the
|
||||
terms of the GNU Affero General Public License as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option) any later
|
||||
version. This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
more details. You should have received a copy of the GNU Affero General Public
|
||||
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { logger, Pattern, stringifyValues } from '@strudel/core';
|
||||
|
||||
const printed = {};
|
||||
|
||||
// counts .print() calls within one synchronous evaluation, then resets for the
|
||||
// next
|
||||
let printIndex = 0;
|
||||
let printIndexResetQueued = false;
|
||||
function nextPrintIndex() {
|
||||
const index = printIndex++;
|
||||
if (!printIndexResetQueued) {
|
||||
printIndexResetQueued = true;
|
||||
queueMicrotask(() => {
|
||||
printIndex = 0;
|
||||
printIndexResetQueued = false;
|
||||
});
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
function formatTime(hap, round, padding) {
|
||||
const begin = hap.wholeOrPart().begin;
|
||||
if (round === 0) {
|
||||
return String(begin.sam().valueOf()).padEnd(padding);
|
||||
}
|
||||
const factor = 10 ** round;
|
||||
const time = Math.round(begin.valueOf() * factor) / factor;
|
||||
return String(time).padEnd(padding + round + 1);
|
||||
}
|
||||
|
||||
function appendLine(el, text, maxLines) {
|
||||
const line = document.createElement('div');
|
||||
line.textContent = text;
|
||||
el.appendChild(line);
|
||||
while (el.childElementCount > maxLines) {
|
||||
el.removeChild(el.firstChild);
|
||||
}
|
||||
if (el.follow) {
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the values of a pattern's events. Without a leading underscore, prints
|
||||
* to the existing console panel, labeled with its position among other
|
||||
* `print()` calls, e.g. `[print(line:1)]`. With the `_` prefix, it shows a
|
||||
* scrollable widget inside the code instead, and its content resets on
|
||||
* every (re-)evaluation.
|
||||
*
|
||||
* @name print
|
||||
* @tags visualization
|
||||
* @param {number} width widget width in px, `_print` only. defaults to 600
|
||||
* @param {number} height widget height in px, `_print` only. defaults to 100
|
||||
* @param {number} maxLines max lines kept, `_print` only. defaults to 500
|
||||
* @param {number} round decimal digits for the event time. defaults to 4. `0`
|
||||
* shows only the cycle
|
||||
* @param {number} padding integer digits reserved for the cycle, so it stays
|
||||
* aligned once cycles reach 10 or 100. defaults to 3
|
||||
* @example
|
||||
* s("bd sd hh cp").print()
|
||||
* @example
|
||||
* s("bd sd hh*2 cp")._print({ round: 5 })
|
||||
*/
|
||||
Pattern.prototype.print = function (options = {}) {
|
||||
const { el, id = 1, maxLines = 500, round = 4, padding = 3 } = options;
|
||||
if (!el) {
|
||||
const label = `print(line:${nextPrintIndex() + 1})`;
|
||||
return this.onTrigger((hap) => {
|
||||
logger(`[${label}] ${formatTime(hap, round, padding)}: ${stringifyValues(hap.value, true)}`);
|
||||
}, false);
|
||||
}
|
||||
printed[id] = new WeakSet();
|
||||
return this.draw(
|
||||
(haps) => {
|
||||
haps
|
||||
.filter((hap) => !printed[id].has(hap))
|
||||
.forEach((hap) => {
|
||||
printed[id].add(hap);
|
||||
appendLine(el, `${formatTime(hap, round, padding)}: ${stringifyValues(hap.value, true)}`, maxLines);
|
||||
});
|
||||
},
|
||||
{ lookbehind: 0, lookahead: 0, id },
|
||||
);
|
||||
};
|
||||
+7
-35
@@ -52,7 +52,6 @@ export function parseControlsFromHap(hap, cps) {
|
||||
controls.unit === 'c' && controls.speed != null && (controls.speed = controls.speed / cps);
|
||||
const channels = controls.channels;
|
||||
channels != undefined && (controls.channels = JSON.stringify(channels));
|
||||
|
||||
return controls;
|
||||
}
|
||||
|
||||
@@ -78,42 +77,16 @@ export async function oscOutput(hap, targetTime, cps = 1) {
|
||||
const controls = parseControlsFromHap(hap, cps);
|
||||
const keyvals = Object.entries(controls).flat();
|
||||
const msg = { address: '/dirt/play', args: keyvals, timestamp: ts };
|
||||
|
||||
if ('oschost' in hap.value) {
|
||||
msg['host'] = hap.value['oschost'];
|
||||
}
|
||||
if ('oscport' in hap.value) {
|
||||
msg['port'] = hap.value['oscport'];
|
||||
}
|
||||
ws.send(JSON.stringify(msg));
|
||||
}
|
||||
|
||||
export async function superdirtTrigger(hap, currentTime, cps = 1, targetTime) {
|
||||
const ws = await connect();
|
||||
const controls = parseControlsFromHap(hap, cps);
|
||||
const ts = collator.calculateTimestamp(currentTime, targetTime) * 1000;
|
||||
|
||||
let oschost = '127.0.0.1';
|
||||
let oscport = 57120;
|
||||
let bushost = oschost;
|
||||
let busport = 57110;
|
||||
|
||||
for (const [k, v] of Object.entries(controls)) {
|
||||
if (k.startsWith('^')) {
|
||||
const bus_idval = v;
|
||||
const msg = JSON.stringify({
|
||||
oschost: bushost,
|
||||
oscport: busport,
|
||||
address: '/c_set',
|
||||
args: bus_idval,
|
||||
timestamp: ts,
|
||||
});
|
||||
// console.log('bus message', msg);
|
||||
ws.send(msg);
|
||||
// So they aren't sent with trigger messages
|
||||
delete controls[k];
|
||||
}
|
||||
}
|
||||
|
||||
if (hap.hasOnset()) {
|
||||
const keyvals = Object.entries(controls).flat();
|
||||
ws.send(JSON.stringify({ oschost, oscport, address: '/dirt/play', args: keyvals, timestamp: ts }));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sends each hap as an OSC message, which can be picked up by SuperCollider or any other OSC-enabled software.
|
||||
@@ -128,4 +101,3 @@ export const osc = register('osc', (pat) => {
|
||||
ensureMinimalOutput();
|
||||
return pat.onSchedule(oscOutput);
|
||||
});
|
||||
export const superdirt = register('superdirt', (pat) => pat._processParts().onTrigger(superdirtTrigger));
|
||||
|
||||
+13
-9
@@ -12,13 +12,18 @@ import { WebSocketServer } from 'ws';
|
||||
import osc from 'osc';
|
||||
|
||||
const WS_PORT = 8080; // WebSocket server port
|
||||
const OSC_REMOTE_IP = '127.0.0.1';
|
||||
const OSC_REMOTE_PORT = 57120;
|
||||
|
||||
const udpPort = new osc.UDPPort({
|
||||
localAddress: '0.0.0.0',
|
||||
localPort: 0,
|
||||
remoteAddress: OSC_REMOTE_IP,
|
||||
remotePort: OSC_REMOTE_PORT,
|
||||
});
|
||||
|
||||
udpPort.open();
|
||||
console.log(`[Sending OSC] ${OSC_REMOTE_IP}:${OSC_REMOTE_PORT}`);
|
||||
|
||||
udpPort.on('error', (e) => {
|
||||
console.log('Error: ', e);
|
||||
@@ -31,24 +36,23 @@ wss.on('connection', (ws) => {
|
||||
console.log('New WebSocket connection');
|
||||
|
||||
ws.on('message', (message) => {
|
||||
let oschost = '127.0.0.1';
|
||||
let oscport = 57120;
|
||||
let osc_host = '127.0.0.1';
|
||||
let osc_port = 57120;
|
||||
|
||||
try {
|
||||
const data = JSON.parse(message);
|
||||
if ('oschost' in data) {
|
||||
oschost = data['oschost'];
|
||||
delete data['oschost'];
|
||||
if ('host' in data) {
|
||||
osc_host = data['host'];
|
||||
}
|
||||
if ('oscport' in data) {
|
||||
oscport = data['oscport'];
|
||||
delete data['oscport'];
|
||||
if ('port' in data) {
|
||||
osc_port = data['port'];
|
||||
}
|
||||
let msg = { address: data['address'], args: data['args'] };
|
||||
if ('timestamp' in data) {
|
||||
msg = { timeTag: osc.timeTag(0, data['timestamp']), packets: [msg] };
|
||||
}
|
||||
udpPort.send(msg, oschost, oscport);
|
||||
|
||||
udpPort.send(msg, osc_host, osc_port);
|
||||
} catch (err) {
|
||||
console.error('Error parsing message:', err);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,68 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`runs examples > example "" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | s:bd cps:0.5 ]",
|
||||
"[ 1/4 → 1/2 | s:hh cps:0.5 ]",
|
||||
"[ 1/2 → 3/4 | s:sd cps:0.5 ]",
|
||||
"[ 3/4 → 1/1 | s:hh cps:0.5 ]",
|
||||
"[ 1/1 → 5/4 | s:bd cps:0.5 ]",
|
||||
"[ 5/4 → 3/2 | s:hh cps:0.5 ]",
|
||||
"[ 3/2 → 7/4 | s:sd cps:0.5 ]",
|
||||
"[ 7/4 → 2/1 | s:hh cps:0.5 ]",
|
||||
"[ 2/1 → 9/4 | s:bd cps:0.5 ]",
|
||||
"[ 9/4 → 5/2 | s:hh cps:0.5 ]",
|
||||
"[ 5/2 → 11/4 | s:sd cps:0.5 ]",
|
||||
"[ 11/4 → 3/1 | s:hh cps:0.5 ]",
|
||||
"[ 3/1 → 13/4 | s:bd cps:0.5 ]",
|
||||
"[ 13/4 → 7/2 | s:hh cps:0.5 ]",
|
||||
"[ 7/2 → 15/4 | s:sd cps:0.5 ]",
|
||||
"[ 15/4 → 4/1 | s:hh cps:0.5 ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "" example index 0 2`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | s:bd cpm:50 ]",
|
||||
"[ 1/4 → 1/2 | s:hh cpm:57.6536686473018 ]",
|
||||
"[ 1/2 → 3/4 | s:sd cpm:64.14213562373095 ]",
|
||||
"[ 3/4 → 1/1 | s:hh cpm:68.47759065022574 ]",
|
||||
"[ 1/1 → 5/4 | s:bd cpm:70 ]",
|
||||
"[ 5/4 → 3/2 | s:hh cpm:68.47759065022574 ]",
|
||||
"[ 3/2 → 7/4 | s:sd cpm:64.14213562373095 ]",
|
||||
"[ 7/4 → 2/1 | s:hh cpm:57.6536686473018 ]",
|
||||
"[ 2/1 → 9/4 | s:bd cpm:50 ]",
|
||||
"[ 9/4 → 5/2 | s:hh cpm:42.34633135269821 ]",
|
||||
"[ 5/2 → 11/4 | s:sd cpm:35.85786437626905 ]",
|
||||
"[ 11/4 → 3/1 | s:hh cpm:31.52240934977427 ]",
|
||||
"[ 3/1 → 13/4 | s:bd cpm:30 ]",
|
||||
"[ 13/4 → 7/2 | s:hh cpm:31.522409349774268 ]",
|
||||
"[ 7/2 → 15/4 | s:sd cpm:35.85786437626905 ]",
|
||||
"[ 15/4 → 4/1 | s:hh cpm:42.34633135269819 ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "" example index 1 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | s:bd cps:1 ]",
|
||||
"[ 1/4 → 1/2 | s:hh cps:1.1913417161825448 ]",
|
||||
"[ 1/2 → 3/4 | s:sd cps:1.3535533905932737 ]",
|
||||
"[ 3/4 → 1/1 | s:hh cps:1.4619397662556435 ]",
|
||||
"[ 1/1 → 5/4 | s:bd cps:1.5 ]",
|
||||
"[ 5/4 → 3/2 | s:hh cps:1.4619397662556435 ]",
|
||||
"[ 3/2 → 7/4 | s:sd cps:1.3535533905932737 ]",
|
||||
"[ 7/4 → 2/1 | s:hh cps:1.1913417161825448 ]",
|
||||
"[ 2/1 → 9/4 | s:bd cps:1 ]",
|
||||
"[ 9/4 → 5/2 | s:hh cps:0.8086582838174552 ]",
|
||||
"[ 5/2 → 11/4 | s:sd cps:0.6464466094067263 ]",
|
||||
"[ 11/4 → 3/1 | s:hh cps:0.5380602337443567 ]",
|
||||
"[ 3/1 → 13/4 | s:bd cps:0.5 ]",
|
||||
"[ 13/4 → 7/2 | s:hh cps:0.5380602337443567 ]",
|
||||
"[ 7/2 → 15/4 | s:sd cps:0.6464466094067262 ]",
|
||||
"[ 15/4 → 4/1 | s:hh cps:0.8086582838174547 ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "_euclidRot" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/5 | note:c3 ]",
|
||||
@@ -2789,29 +2852,6 @@ exports[`runs examples > example "cosine" example index 0 1`] = `
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "cpm" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/3 | s:hh ]",
|
||||
"[ 0/1 → 2/3 | s:bd ]",
|
||||
"[ 1/3 → 2/3 | s:hh ]",
|
||||
"[ 2/3 → 1/1 | s:hh ]",
|
||||
"[ 2/3 → 4/3 | s:sd ]",
|
||||
"[ 1/1 → 4/3 | s:hh ]",
|
||||
"[ 4/3 → 5/3 | s:hh ]",
|
||||
"[ 4/3 → 2/1 | s:bd ]",
|
||||
"[ 5/3 → 2/1 | s:hh ]",
|
||||
"[ 2/1 → 7/3 | s:hh ]",
|
||||
"[ 2/1 → 8/3 | s:sd ]",
|
||||
"[ 7/3 → 8/3 | s:hh ]",
|
||||
"[ 8/3 → 3/1 | s:hh ]",
|
||||
"[ 8/3 → 10/3 | s:bd ]",
|
||||
"[ 3/1 → 10/3 | s:hh ]",
|
||||
"[ 10/3 → 11/3 | s:hh ]",
|
||||
"[ 10/3 → 4/1 | s:sd ]",
|
||||
"[ 11/3 → 4/1 | s:hh ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "crush" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/6 | s:hh crush:16 ]",
|
||||
@@ -10004,52 +10044,6 @@ exports[`runs examples > example "pressBy" example index 0 1`] = `
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "print" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | s:bd ]",
|
||||
"[ 1/4 → 1/2 | s:sd ]",
|
||||
"[ 1/2 → 3/4 | s:hh ]",
|
||||
"[ 3/4 → 1/1 | s:cp ]",
|
||||
"[ 1/1 → 5/4 | s:bd ]",
|
||||
"[ 5/4 → 3/2 | s:sd ]",
|
||||
"[ 3/2 → 7/4 | s:hh ]",
|
||||
"[ 7/4 → 2/1 | s:cp ]",
|
||||
"[ 2/1 → 9/4 | s:bd ]",
|
||||
"[ 9/4 → 5/2 | s:sd ]",
|
||||
"[ 5/2 → 11/4 | s:hh ]",
|
||||
"[ 11/4 → 3/1 | s:cp ]",
|
||||
"[ 3/1 → 13/4 | s:bd ]",
|
||||
"[ 13/4 → 7/2 | s:sd ]",
|
||||
"[ 7/2 → 15/4 | s:hh ]",
|
||||
"[ 15/4 → 4/1 | s:cp ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "print" example index 1 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/4 | s:bd ]",
|
||||
"[ 1/4 → 1/2 | s:sd ]",
|
||||
"[ 1/2 → 5/8 | s:hh ]",
|
||||
"[ 5/8 → 3/4 | s:hh ]",
|
||||
"[ 3/4 → 1/1 | s:cp ]",
|
||||
"[ 1/1 → 5/4 | s:bd ]",
|
||||
"[ 5/4 → 3/2 | s:sd ]",
|
||||
"[ 3/2 → 13/8 | s:hh ]",
|
||||
"[ 13/8 → 7/4 | s:hh ]",
|
||||
"[ 7/4 → 2/1 | s:cp ]",
|
||||
"[ 2/1 → 9/4 | s:bd ]",
|
||||
"[ 9/4 → 5/2 | s:sd ]",
|
||||
"[ 5/2 → 21/8 | s:hh ]",
|
||||
"[ 21/8 → 11/4 | s:hh ]",
|
||||
"[ 11/4 → 3/1 | s:cp ]",
|
||||
"[ 3/1 → 13/4 | s:bd ]",
|
||||
"[ 13/4 → 7/2 | s:sd ]",
|
||||
"[ 7/2 → 29/8 | s:hh ]",
|
||||
"[ 29/8 → 15/4 | s:hh ]",
|
||||
"[ 15/4 → 4/1 | s:cp ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "progNum" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/1 | note:c4 progNum:10 midichan:1 ]",
|
||||
|
||||
@@ -97,7 +97,6 @@ const toneHelpersMocked = {
|
||||
'_pitchwheel',
|
||||
'_pianoroll',
|
||||
'_spectrum',
|
||||
'_print',
|
||||
'markcss',
|
||||
'p',
|
||||
'dough',
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<script is:inline>
|
||||
window.location.pathname = `/workshop/getting-started`;
|
||||
</script>
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Getting Started
|
||||
layout: ../../layouts/MainLayout.astro
|
||||
---
|
||||
|
||||
import { MiniRepl } from '../../docs/MiniRepl';
|
||||
import { JsDoc } from '../../docs/JsDoc';
|
||||
|
||||
# Welcome
|
||||
|
||||
Welcome to the Strudel documentation pages!
|
||||
|
||||
These pages will introduce you to [Strudel](https://strudel.cc/), 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?
|
||||
|
||||
[Strudel](https://strudel.cc/) is a version of [Tidal Cycles](https://tidalcycles.org) written in [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), initiated by [Alex McLean](https://slab.org) and [Felix Roos](https://froos.cc/) in 2022, quickly growing into a collective free/open source project with major [contributors and maintainers](https://codeberg.org/uzu/strudel/activity/contributors) including [Jade Rowland](https://www.instagram.com/_switch_angel/) and [Aria](https://www.instagram.com/gglossingg/).
|
||||
Tidal Cycles, also known as Tidal, is a language for [algorithmic pattern](https://algorithmicpattern.org), and though it is most commonly used for [making music](https://tidalcycles.org/docs/showcase), it can be used for any kind of pattern making activity, including [weaving](https://www.youtube.com/watch?v=TfEmEsusXjU).
|
||||
|
||||
Tidal was first implemented as a library written in the [Haskell](https://www.haskell.org/) functional programming language, and by itself it does not make any sound.
|
||||
To make sound, it has to be connected to a sound engine, and by default this is a [SuperCollider](https://supercollider.github.io/) plugin called [SuperDirt](https://github.com/musikinformatik/SuperDirt/).
|
||||
As such, it can be difficult for first-time users to install both Tidal Cycles and SuperDirt, as there are many small details to get right.
|
||||
Strudel however runs directly in your web browser, does not require any custom software installation, and can make sound all by itself.
|
||||
|
||||
# Strudel REPL and MiniREPL
|
||||
|
||||
The main place to actually make music with Strudel is the [Strudel REPL](https://strudel.cc/) ([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:
|
||||
|
||||
<MiniRepl client:idle tune={`s("bd sd")`} punchcard />
|
||||
|
||||
Then edit the text so it reads `s("bd sd cp hh")` and click the refresh icon.
|
||||
Congratulations, you have now live coded your first Strudel pattern!
|
||||
|
||||
With Strudel, you can expressively write dynamic music pieces.
|
||||
You don't need to know JavaScript or Tidal Cycles to make music with Strudel.
|
||||
This interactive tutorial will guide you through the basics of Strudel.
|
||||
|
||||
# Show me some demos!
|
||||
|
||||
To see and hear what Strudel can do, visit the [Strudel REPL](https://strudel.cc/) and click the Shuffle icon in the top menu bar.
|
||||
You can get a feel for Strudel by browsing and editing these examples and clicking the Refresh icon to update.
|
||||
|
||||
You can also browse through the examples [here](/examples).
|
||||
|
||||
Alternatively, you can get a taste of what Strudel can do by clicking play on this track:
|
||||
|
||||
<MiniRepl
|
||||
client:idle
|
||||
tune={`samples({
|
||||
bd: ['bd/BT0AADA.wav','bd/BT0AAD0.wav','bd/BT0A0DA.wav','bd/BT0A0D3.wav','bd/BT0A0D0.wav','bd/BT0A0A7.wav'],
|
||||
sd: ['sd/rytm-01-classic.wav','sd/rytm-00-hard.wav'],
|
||||
hh: ['hh27/000_hh27closedhh.wav','hh/000_hh3closedhh.wav'],
|
||||
}, 'github:tidalcycles/dirt-samples');
|
||||
stack(
|
||||
s("bd,[~ <sd!3 sd(3,4,2)>],hh*8") // drums
|
||||
.speed(perlin.range(.7,.9)) // random sample speed variation
|
||||
,"<a1 b1\*2 a1(3,8) e2>" // bassline
|
||||
.off(1/8,x=>x.add(12).degradeBy(.5)) // random octave jumps
|
||||
.add(perlin.range(0,.5)) // random pitch variation
|
||||
.superimpose(add(.05)) // add second, slightly detuned voice
|
||||
.note() // wrap in "note"
|
||||
.decay(.15).sustain(0) // make each note of equal length
|
||||
.s('sawtooth') // waveform
|
||||
.gain(.4) // turn down
|
||||
.cutoff(sine.slow(7).range(300,5000)) // automate cutoff
|
||||
,"<Am7!3 <Em7 E7b13 Em7 Ebm7b5>>".voicings('lefthand') // chords
|
||||
.superimpose(x=>x.add(.04)) // add second, slightly detuned voice
|
||||
.add(perlin.range(0,.5)) // random pitch variation
|
||||
.note() // wrap in "note"
|
||||
.s('sawtooth') // waveform
|
||||
.gain(.16) // turn down
|
||||
.cutoff(500) // fixed cutoff
|
||||
.attack(1) // slowly fade in
|
||||
)
|
||||
.slow(3/2)`}
|
||||
/>
|
||||
|
||||
# Strudel is a work in progress 🚧
|
||||
|
||||
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.
|
||||
You can contribute to it clicking 'Edit this page' in the top right, or by visiting the [Strudel GitHub page](https://codeberg.org/uzu/strudel/).
|
||||
|
||||
# What's next?
|
||||
|
||||
Head on over to the [Notes](/learn/notes) page.
|
||||
|
||||
<br />
|
||||
@@ -1,3 +0,0 @@
|
||||
<script is:inline>
|
||||
window.location.pathname = `/workshop/first-notes`;
|
||||
</script>
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Notes
|
||||
layout: ../../layouts/MainLayout.astro
|
||||
---
|
||||
|
||||
import { MiniRepl } from '../../docs/MiniRepl';
|
||||
import { JsDoc } from '../../docs/JsDoc';
|
||||
|
||||
# Notes
|
||||
|
||||
Pitches are an important building block in many musical traditions.
|
||||
In Strudel, pitches can be expressed as note names, note numbers or frequencies.
|
||||
Here's the same pattern written in three different ways:
|
||||
|
||||
- `note`: letter notation, good for those who are familiar with western music theory:
|
||||
|
||||
<MiniRepl client:idle tune={`note("a3 c#4 e4 a4")`} />
|
||||
|
||||
- `note`: number notation, good for those who want to use recognisable pitches, but don't care about music theory:
|
||||
|
||||
<MiniRepl client:idle tune={`note("57 61 64 69")`} />
|
||||
|
||||
- `freq`: frequency notation, good for those who want to go beyond standardised tuning systems:
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440")`} />
|
||||
|
||||
Let's look at those in more detail...
|
||||
|
||||
## `note` names
|
||||
|
||||
Notes names can be notated with the note letter, followed by the octave number. You can notate flats with `b` and sharps with `#`.
|
||||
|
||||
<MiniRepl client:idle tune={`note("a3 c#4 e4 a4")`} />
|
||||
|
||||
By the way, you can edit the contents of the player, and press "update" to hear your change!
|
||||
You can also press "play" on the next player without needing to stop the last one.
|
||||
|
||||
## `note` numbers
|
||||
|
||||
If you prefer, you can also use numbers with `note` instead:
|
||||
|
||||
<MiniRepl client:idle tune={`note("57 61 64 69")`} />
|
||||
|
||||
These numbers are interpreted as so called [MIDI numbers](https://www.inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies), where adjacent whole numbers are one 'semitone' apart.
|
||||
|
||||
You could also write decimal numbers to get 'microtonal' pitches (in between the black and white piano notes):
|
||||
|
||||
<MiniRepl client:idle tune={`note("74.5 75 75.5 76")`} />
|
||||
|
||||
## `freq`
|
||||
|
||||
To get maximum freedom, you can also use `freq` to directly control the frequency:
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440")`} />
|
||||
|
||||
## Hearing and frequency
|
||||
|
||||
In the above example, we play A3 (220Hz), C#4 natural (275Hz), E4 (330Hz) and A4 (440Hz), mirroring our previous examples.
|
||||
|
||||
But can you hear the difference between these individual frequencies?
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 221 223 224")`} />
|
||||
|
||||
How about these?
|
||||
|
||||
<MiniRepl client:idle tune={`freq("2020 2021 2023 2024")`} />
|
||||
|
||||
The higher we go up...
|
||||
|
||||
<MiniRepl client:idle tune={`freq("5020 5021 5023 5024")`} />
|
||||
|
||||
The less distance we can hear between the frequencies!
|
||||
|
||||
<MiniRepl client:idle tune={`freq("10020 10021 10023 10024")`} />
|
||||
|
||||
Why is this? [Human hearing operates logarithmically](https://www.audiocheck.net/soundtests_nonlinear.php).
|
||||
|
||||
## From notes to sounds
|
||||
|
||||
In this page, when we played a pattern of notes like this:
|
||||
|
||||
<MiniRepl client:idle tune={`note("a3 c#4 e4 a4")`} />
|
||||
|
||||
We heard a simple synthesised sound, in fact we heard a [triangle wave oscillator](https://en.wikipedia.org/wiki/Triangle_wave).
|
||||
|
||||
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).
|
||||
|
||||
<br />
|
||||
@@ -1,3 +0,0 @@
|
||||
<script is:inline>
|
||||
window.location.pathname = `/workshop/first-sounds`;
|
||||
</script>
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: Sounds
|
||||
layout: ../../layouts/MainLayout.astro
|
||||
---
|
||||
|
||||
import { MiniRepl } from '../../docs/MiniRepl';
|
||||
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:
|
||||
<MiniRepl client:idle tune={`s("bd hh sd hh")`} />
|
||||
- `s` can trigger audio synthesisers, which are synthesised in real-time using code also running in the background:
|
||||
<MiniRepl client:idle tune={`s("sawtooth square triangle sine")`} />
|
||||
|
||||
You can learn more about both of these approaches in the pages [Synths](/learn/synths) and [Samples](/learn/samples).
|
||||
|
||||
# Combining notes and sounds
|
||||
|
||||
In both of the above cases, we are no longer directly controlling the `note`/`freq` of the sound heard via `s`, as we were in the [Notes](/workshop/first-notes/) page.
|
||||
|
||||
So how can we both control the sound and the pitch? We can _combine_ `note`/`freq` with `s` to change the sound of our pitches:
|
||||
|
||||
<MiniRepl client:idle tune={`note("a3 c#4 e4 a4").s("sawtooth")`} />
|
||||
|
||||
<MiniRepl client:idle tune={`note("57 61 64 69").s("sine")`} />
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440").s("triangle")`} />
|
||||
|
||||
The last example will actually sound the same with or without `s`, because `triangle` is the default value for `s`.
|
||||
|
||||
What about combining different notes with different sounds at the same time?
|
||||
|
||||
<MiniRepl client:idle tune={`freq("220 275 330 440 550").s("triangle sawtooth sine")`} />
|
||||
|
||||
Hmm, something interesting is going on there, related to there being five notes and three sounds.
|
||||
|
||||
Let's now take a step back and think about the Strudel [Code](/learn/code/) we've been hearing so far.
|
||||
@@ -103,10 +103,6 @@ What follows is the API doc of all the options you can pass:
|
||||
|
||||
<JsDoc client:idle name="spectrum" h={0} />
|
||||
|
||||
## Print
|
||||
|
||||
<JsDoc client:idle name="print" h={0} />
|
||||
|
||||
## markcss
|
||||
|
||||
<JsDoc client:idle name="markcss" h={0} />
|
||||
|
||||
@@ -186,7 +186,7 @@ But don't worry if you don't know these terms, as they are not required to make
|
||||
|
||||
</Box>
|
||||
|
||||
**Add a rest in a sequence with '-' or '~'**
|
||||
**Add a rests in a sequence with '-' or '~'**
|
||||
|
||||
<MiniRepl client:visible tune={`sound("bd hh - rim - bd hh rim")`} punchcard />
|
||||
|
||||
|
||||
@@ -13,41 +13,24 @@ import { examples } from '../../examples.mjs';
|
||||
Welcome to the Strudel documentation pages!
|
||||
You've come to the right place if you want to learn how to make music with code.
|
||||
|
||||
These pages will introduce you to [Strudel](https://strudel.cc/), a web-based [live coding](https://codeberg.org/toplap/awesome-livecoding/) environment that implements the [Tidal Cycles](https://tidalcycles.org) algorithmic pattern language.
|
||||
|
||||
## What is Strudel?
|
||||
|
||||
With Strudel, you can expressively write dynamic music pieces.<br/>
|
||||
|
||||
[Strudel](https://strudel.cc/) is a version of [Tidal Cycles](https://tidalcycles.org) written in [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), initiated by [Alex McLean](https://slab.org) and [Felix Roos](https://froos.cc/) in 2022, quickly growing into a collective free/open source project with major [contributors and maintainers](https://codeberg.org/uzu/strudel/activity/contributors) including [Jade Rowland](https://www.instagram.com/_switch_angel/) and [Aria](https://www.instagram.com/gglossingg/).
|
||||
Tidal Cycles, also known as Tidal, is a language for [algorithmic pattern](https://algorithmicpattern.org), and though it is most commonly used for [making music](https://tidalcycles.org/docs/showcase), it can be used for any kind of pattern making activity, including [weaving](https://www.youtube.com/watch?v=TfEmEsusXjU).
|
||||
|
||||
Tidal was first implemented as a library written in the [Haskell](https://www.haskell.org/) functional programming language, and by itself it does not make any sound.
|
||||
To make sound, it has to be connected to a sound engine, and by default this is a [SuperCollider](https://supercollider.github.io/) plugin called [SuperDirt](https://codeberg.org/musikinformatik/SuperDirt).
|
||||
As such, it can be difficult for first-time users to install both Tidal Cycles and SuperDirt, as there are many small details to get right.
|
||||
Strudel however runs directly in your web browser, does not require any custom software installation, and can make sound all by itself.
|
||||
|
||||
It is an official port of the [Tidal Cycles](https://tidalcycles.org/) pattern language to JavaScript.<br/>
|
||||
You don't need to know JavaScript or Tidal Cycles to make music with Strudel.
|
||||
This interactive tutorial will guide you through the basics of Strudel.<br/>
|
||||
The best place to actually make music with Strudel is the [Strudel REPL](https://strudel.cc/)
|
||||
|
||||
<div className="clear-both" />
|
||||
|
||||
## What can you do with Strudel?
|
||||
|
||||
- Live code music: make music with code in real time.
|
||||
- Algorithmic composition: compose music using tidal's unique approach to pattern manipulation.
|
||||
- Teaching: focussing on a low barrier of entry, Strudel is a good fit for teaching music and code at the same time.
|
||||
- Integrate into your existing music setup: either via MIDI or OSC, you can use Strudel as a really flexible sequencer.
|
||||
- live code music: make music with code in real time
|
||||
- algorithmic composition: compose music using tidal's unique approach to pattern manipulation
|
||||
- teaching: focussing on a low barrier of entry, Strudel is a good fit for teaching music and code at the same time.
|
||||
- integrate into your existing music setup: either via MIDI or OSC, you can use Strudel as a really flexible sequencer
|
||||
|
||||
## Strudel REPL and MiniREPL
|
||||
|
||||
The main place to actually make music with Strudel is the [Strudel REPL](https://strudel.cc/) ([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:
|
||||
|
||||
<MiniRepl client:idle tune={`s("bd sd")`} punchcard />
|
||||
|
||||
Then edit the text so it reads `s("bd sd cp hh")` and click the refresh icon.
|
||||
Congratulations, you have now live coded your first Strudel pattern!
|
||||
|
||||
## Show me some demos!
|
||||
## Examples
|
||||
|
||||
Here are some examples of how strudel can sound:
|
||||
|
||||
@@ -55,10 +38,6 @@ Here are some examples of how strudel can sound:
|
||||
|
||||
These examples cannot fully encompass the variety of things you can do, so [check out the showcase](/intro/showcase/) for some videos of how people use Strudel.
|
||||
|
||||
## Contribute to Strudel
|
||||
|
||||
You can contribute to it clicking 'Edit this page' in the top right, or by visiting the [Strudel Codeberg page](https://codeberg.org/uzu/strudel/).
|
||||
|
||||
## Getting Started
|
||||
|
||||
The best way to start learning Strudel is the workshop.
|
||||
|
||||
@@ -11,7 +11,7 @@ import QA from '@components/QA';
|
||||
|
||||
Up until now, most of the functions we've seen are what other music programs are typically capable of: sequencing sounds, playing notes, controlling effects.
|
||||
|
||||
In this chapter, we are going to look at functions that are more unique to Strudel.
|
||||
In this chapter, we are going to look at functions that are more unique to tidal.
|
||||
|
||||
**reverse patterns with rev**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user