Compare commits

..

17 Commits

Author SHA1 Message Date
alex c49c56a86e twiddle 2025-12-02 09:36:09 +00:00
alex 02fae316d9 twiddle 2025-12-02 09:31:09 +00:00
alex 4f51fc2d47 twiddle 2025-12-02 09:28:23 +00:00
alex 6cca5f422b oops 2025-12-02 08:55:02 +00:00
alex 60cb4246f9 try to simplify 2025-12-02 08:37:29 +00:00
alex 2b291e4463 add more parens 2025-12-01 23:39:19 +00:00
alex 72e3e1ac66 deploy on push to main 2025-12-01 23:25:43 +00:00
froos 7a3e0fd3fe Merge pull request 'added export to getSuperdoughAudioController() so that its possible to route superdough audio through other webaudio applications.' (#1796) from ndr0n/strudel:exportSuperdoughAudioController into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1796
2025-11-29 01:00:41 +01:00
Alex McLean 4061dd4cf8 Merge pull request 'add revv() for reversing whole patterns' (#1791) from revv into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1791
2025-11-28 23:26:19 +01:00
alex b523205590 Merge branch 'revv' of ssh://codeberg.org/uzu/strudel into revv 2025-11-28 22:03:32 +00:00
alex 956598da18 snapshot 2025-11-28 22:03:21 +00:00
Alex McLean e011f3b982 Merge branch 'main' into revv 2025-11-28 22:37:03 +01:00
alex cb591815ed fix copy paste errors 2025-11-28 21:35:35 +00:00
Alex McLean 6a4fd27f5b Merge branch 'main' into exportSuperdoughAudioController 2025-11-28 22:32:10 +01:00
Aria d30df8d4cf Merge pull request '[perf] Disconnect lfos for phaser and filters' (#1787) from glossing/perf-lfos into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1787
2025-11-28 20:19:14 +01:00
ndr0n a6008e2700 added export to getSuperdoughAudioController() so that its possible to route superdough audio on external application integrations. 2025-11-28 04:03:48 +00:00
Alex McLean f4b1baac87 add revv() for reversing whole patterns 2025-11-27 15:34:18 +00:00
5 changed files with 70 additions and 4 deletions
+26 -2
View File
@@ -1,16 +1,27 @@
name: Strudel tests
name: Strudel test + warm deploy
on: [push, pull_request]
jobs:
build:
test-and-warm-deploy:
runs-on: docker
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Debug Forgejo context
run: |
echo "hmm"
echo "EVENT_NAME = ${{ forgejo.event_name }}"
echo "REF = ${{ forgejo.ref }}"
echo "REF_NAME = ${{ forgejo.ref_name }}"
echo "EVENT_NAME = $FORGEJO_EVENT_NAME"
echo "REF = $FORGEJO_REF"
echo "REF_NAME = $FORGEJO_REF_NAME"
- name: apt install ztd
run: apt update && apt install -y zstd
- uses: pnpm/action-setup@v4
@@ -24,3 +35,16 @@ jobs:
- run: pnpm run format-check
- run: pnpm run lint
- run: pnpm test
- name: Build
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: pnpm build
- name: Warm deploy
# automatically deploy to warm on pushes to main
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/warm.strudel.cc
+18 -1
View File
@@ -2234,7 +2234,7 @@ export const brak = register('brak', function (pat) {
});
/**
* Reverse all haps in a pattern
* Reverse all cycles in a pattern. See also `revv` for reversing a whole pattern.
*
* @name rev
* @memberof Pattern
@@ -2266,6 +2266,23 @@ export const rev = register(
true,
);
/**
* Reverse a whole pattern. See also `rev` for reversing each cycle.
*
* @name revv
* @memberof Pattern
* @returns Pattern
* @example
* // This is the same as `<[g e] [d c]>`. If `rev()` is used, you get
* // the same as `<[d c] [g e]>`, where each cycle reverses, but the order of
* // cycles stays the same.
* note("<[c d] [e g]>").revv()
*/
export const revv = register('revv', function (pat) {
const negateSpan = (span) => new TimeSpan(Fraction(0).sub(span.end), Fraction(0).sub(span.begin));
return pat.withQuerySpan(negateSpan).withHapSpan(negateSpan);
});
/** Like press, but allows you to specify the amount by which each
* event is shifted. pressBy(0.5) is the same as press, while
* pressBy(1/3) shifts each event by a third of its timespan.
+12
View File
@@ -586,6 +586,18 @@ describe('Pattern', () => {
.map((a) => a.value),
).toStrictEqual(['c', 'b', 'a']);
});
it('Does not reverse the order of cycles', () => {
expect(fastcat('a', 'b', 'c', 'd').slow(2).rev().fast(2).sortHapsByPart().firstCycle()).toStrictEqual(
fastcat('b', 'a', 'd', 'c').firstCycle(),
);
});
});
describe('revv()', () => {
it('Does reverse the order of cycles', () => {
expect(fastcat('a', 'b', 'c', 'd').slow(2).revv().fast(2).sortHapsByPart().firstCycle()).toStrictEqual(
fastcat('d', 'c', 'b', 'a').firstCycle(),
);
});
});
describe('sequence()', () => {
it('Can work like fastcat', () => {
+1 -1
View File
@@ -274,7 +274,7 @@ export async function initAudioOnFirstClick(options) {
}
let controller;
function getSuperdoughAudioController() {
export function getSuperdoughAudioController() {
if (controller == null) {
controller = new SuperdoughAudioController(getAudioContext());
}
+13
View File
@@ -9256,6 +9256,19 @@ exports[`runs examples > example "rev" example index 0 1`] = `
]
`;
exports[`runs examples > example "revv" example index 0 1`] = `
[
"[ 0/1 → 1/2 | note:g ]",
"[ 1/2 → 1/1 | note:e ]",
"[ 1/1 → 3/2 | note:d ]",
"[ 3/2 → 2/1 | note:c ]",
"[ 2/1 → 5/2 | note:g ]",
"[ 5/2 → 3/1 | note:e ]",
"[ 3/1 → 7/2 | note:d ]",
"[ 7/2 → 4/1 | note:c ]",
]
`;
exports[`runs examples > example "ribbon" example index 0 1`] = `
[
"[ 0/1 → 1/1 | note:d ]",