mirror of
https://codeberg.org/uzu/strudel
synced 2026-10-03 16:17:03 -04:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d58b3e490b | |||
| 0003ce174e | |||
| 8e0f23e081 | |||
| 71e60ed8de | |||
| e2a29914c7 | |||
| a9a3d491a2 | |||
| a750764f88 | |||
| 5b397009ab | |||
| e68df9e789 | |||
| 4d3bbd5057 | |||
| c0184dd827 | |||
| 09fdc45ff2 | |||
| c01b4c651c | |||
| 634eed1d82 | |||
| a1d181d609 | |||
| 440f1cb081 | |||
| 95193b0bfd | |||
| 81ca199a96 | |||
| 8d8b8ab99e | |||
| a4f10d5339 | |||
| 33a73c37bc | |||
| 4e6d39666a | |||
| a5b6022506 |
+1
-1
@@ -17,7 +17,7 @@ git remote set-url origin git@codeberg.org:uzu/strudel.git
|
|||||||
|
|
||||||
To get in touch with the contributors, either
|
To get in touch with the contributors, either
|
||||||
|
|
||||||
- [join the Tidal Discord Channel](https://discord.gg/remJ6gQA) and go to the #strudel channel
|
- [join the Tidal Discord Channel](https://discord.com/invite/HGEdXmRkzT) and go to the #strudel channel
|
||||||
- Find related discussions on the [tidal club forum](https://club.tidalcycles.org/)
|
- Find related discussions on the [tidal club forum](https://club.tidalcycles.org/)
|
||||||
|
|
||||||
## Ask a Question
|
## Ask a Question
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ This project is organized into many [packages](./packages), which are also avail
|
|||||||
|
|
||||||
Read more about how to use these in your own project [here](https://strudel.cc/technical-manual/project-start).
|
Read more about how to use these in your own project [here](https://strudel.cc/technical-manual/project-start).
|
||||||
|
|
||||||
You will need to abide by the terms of the [GNU Affero Public Licence v3](LICENSE.md). As such, Strudel code can only be shared within free/open source projects under the same license -- see the license for details.
|
You will need to abide by the terms of the [GNU Affero Public Licence v3](LICENSE). As such, Strudel code can only be shared within free/open source projects under the same license -- see the license for details.
|
||||||
|
|
||||||
Licensing info for the default sound banks can be found over on the [dough-samples](https://github.com/felixroos/dough-samples/blob/main/README.md) repository.
|
Licensing info for the default sound banks can be found over on the [dough-samples](https://github.com/felixroos/dough-samples/blob/main/README.md) repository.
|
||||||
|
|
||||||
|
|||||||
@@ -2720,7 +2720,7 @@ export function stepcat(...timepats) {
|
|||||||
if (timepats.length === 0) {
|
if (timepats.length === 0) {
|
||||||
return nothing;
|
return nothing;
|
||||||
}
|
}
|
||||||
const findsteps = (x) => (Array.isArray(x) ? x : [x._steps, x]);
|
const findsteps = (x) => (Array.isArray(x) ? x : [x._steps ?? 1, x]);
|
||||||
timepats = timepats.map(findsteps);
|
timepats = timepats.map(findsteps);
|
||||||
if (timepats.find((x) => x[0] === undefined)) {
|
if (timepats.find((x) => x[0] === undefined)) {
|
||||||
const times = timepats.map((a) => a[0]).filter((x) => x !== undefined);
|
const times = timepats.map((a) => a[0]).filter((x) => x !== undefined);
|
||||||
|
|||||||
@@ -113,8 +113,9 @@ export function repl({
|
|||||||
* all(x => x.pianoroll())
|
* all(x => x.pianoroll())
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
let allTransforms = [];
|
||||||
const all = function (transform) {
|
const all = function (transform) {
|
||||||
allTransform = transform;
|
allTransforms.push(transform);
|
||||||
return silence;
|
return silence;
|
||||||
};
|
};
|
||||||
/** Applies a function to each of the running patterns separately. This is intended for future use with upcoming 'stepwise' features. See `all` for a version that applies the function to all the patterns stacked together into a single pattern.
|
/** Applies a function to each of the running patterns separately. This is intended for future use with upcoming 'stepwise' features. See `all` for a version that applies the function to all the patterns stacked together into a single pattern.
|
||||||
@@ -190,6 +191,7 @@ export function repl({
|
|||||||
await injectPatternMethods();
|
await injectPatternMethods();
|
||||||
setTime(() => scheduler.now()); // TODO: refactor?
|
setTime(() => scheduler.now()); // TODO: refactor?
|
||||||
await beforeEval?.({ code });
|
await beforeEval?.({ code });
|
||||||
|
allTransforms = []; // reset all transforms
|
||||||
shouldHush && hush();
|
shouldHush && hush();
|
||||||
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions);
|
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions);
|
||||||
if (Object.keys(pPatterns).length) {
|
if (Object.keys(pPatterns).length) {
|
||||||
@@ -202,8 +204,10 @@ export function repl({
|
|||||||
} else if (eachTransform) {
|
} else if (eachTransform) {
|
||||||
pattern = eachTransform(pattern);
|
pattern = eachTransform(pattern);
|
||||||
}
|
}
|
||||||
if (allTransform) {
|
if (allTransforms.length) {
|
||||||
pattern = allTransform(pattern);
|
for (let i in allTransforms) {
|
||||||
|
pattern = allTransforms[i](pattern);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!isPattern(pattern)) {
|
if (!isPattern(pattern)) {
|
||||||
const message = `got "${typeof evaluated}" instead of pattern`;
|
const message = `got "${typeof evaluated}" instead of pattern`;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import {
|
|||||||
stackCentre,
|
stackCentre,
|
||||||
stepcat,
|
stepcat,
|
||||||
sometimes,
|
sometimes,
|
||||||
|
expand,
|
||||||
} from '../index.mjs';
|
} from '../index.mjs';
|
||||||
|
|
||||||
import { steady } from '../signal.mjs';
|
import { steady } from '../signal.mjs';
|
||||||
@@ -1179,6 +1180,9 @@ describe('Pattern', () => {
|
|||||||
it('calculates undefined steps as the average', () => {
|
it('calculates undefined steps as the average', () => {
|
||||||
expect(sameFirst(stepcat(pure(1), pure(2), pure(3).setSteps(undefined)), fastcat(1, 2, 3)));
|
expect(sameFirst(stepcat(pure(1), pure(2), pure(3).setSteps(undefined)), fastcat(1, 2, 3)));
|
||||||
});
|
});
|
||||||
|
it('works with auto-reified values', () => {
|
||||||
|
expect(sameFirst(stepcat(expand(3, 'bd'), 'rim'), stepcat(expand(3, 'bd'), pure('rim'))));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('shrink', () => {
|
describe('shrink', () => {
|
||||||
it('can shrink', () => {
|
it('can shrink', () => {
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ describe('tonal', () => {
|
|||||||
.firstCycleValues.map((h) => h.note),
|
.firstCycleValues.map((h) => h.note),
|
||||||
).toEqual(['C3', 'D3', 'E3']);
|
).toEqual(['C3', 'D3', 'E3']);
|
||||||
});
|
});
|
||||||
|
it('scale without tonic', () => {
|
||||||
|
expect(
|
||||||
|
n(0, 1, 2)
|
||||||
|
.scale('major')
|
||||||
|
.firstCycleValues.map((h) => h.note),
|
||||||
|
).toEqual(['C3', 'D3', 'E3']);
|
||||||
|
});
|
||||||
it('scale with mininotation colon', () => {
|
it('scale with mininotation colon', () => {
|
||||||
expect(
|
expect(
|
||||||
n(0, 1, 2)
|
n(0, 1, 2)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function scaleStep(step, scale) {
|
|||||||
scale = scale.replaceAll(':', ' ');
|
scale = scale.replaceAll(':', ' ');
|
||||||
step = Math.ceil(step);
|
step = Math.ceil(step);
|
||||||
let { intervals, tonic, empty } = Scale.get(scale);
|
let { intervals, tonic, empty } = Scale.get(scale);
|
||||||
if ((empty && isNote(scale)) || (!empty && !tonic)) {
|
if ((empty && isNote(scale)) || (empty && !tonic)) {
|
||||||
throw new Error(`incomplete scale. Make sure to use ":" instead of spaces, example: .scale("C:major")`);
|
throw new Error(`incomplete scale. Make sure to use ":" instead of spaces, example: .scale("C:major")`);
|
||||||
} else if (empty) {
|
} else if (empty) {
|
||||||
throw new Error(`invalid scale "${scale}"`);
|
throw new Error(`invalid scale "${scale}"`);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function WelcomeTab({ context }) {
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{/* To learn more about what this all means, check out the{' '} */}
|
{/* To learn more about what this all means, check out the{' '} */}
|
||||||
To get started, check out the
|
To get started, check out the{' '}
|
||||||
<a href={`${baseNoTrailing}/workshop/getting-started/`} target="_blank">
|
<a href={`${baseNoTrailing}/workshop/getting-started/`} target="_blank">
|
||||||
interactive tutorial
|
interactive tutorial
|
||||||
</a>
|
</a>
|
||||||
@@ -43,7 +43,7 @@ export function WelcomeTab({ context }) {
|
|||||||
</a>
|
</a>
|
||||||
. You can find the source code at{' '}
|
. You can find the source code at{' '}
|
||||||
<a href="https://codeberg.org/uzu/strudel" target="_blank">
|
<a href="https://codeberg.org/uzu/strudel" target="_blank">
|
||||||
github
|
codeberg
|
||||||
</a>
|
</a>
|
||||||
. You can also find <a href="https://github.com/felixroos/dough-samples/blob/main/README.md">licensing info</a>{' '}
|
. You can also find <a href="https://github.com/felixroos/dough-samples/blob/main/README.md">licensing info</a>{' '}
|
||||||
for the default sound banks there. Please consider to{' '}
|
for the default sound banks there. Please consider to{' '}
|
||||||
|
|||||||
Reference in New Issue
Block a user