Compare commits

..

25 Commits

Author SHA1 Message Date
Aria 27200e31a4 Add back options code (will resolve in another PR) 2025-11-25 11:26:59 -06:00
Aria 77c1e9938b Remove base url from sample server and properly handle url schemes 2025-11-20 12:46:29 -06:00
W-A-James 8763eba2f7 remove extraneous eslint ignore directive 2025-10-31 15:45:27 -05:00
W-A-James e1c4948f8a Fix trampling of port env variable 2025-10-26 14:28:36 -05:00
Alex McLean 7cef558440 Merge pull request 'Fix ZZFX example' (#1685) from moumar/strudel:fix-zzfx-example into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1685
2025-10-26 17:09:20 +01:00
Alex McLean c261fb6dd6 Merge branch 'main' into fix-zzfx-example 2025-10-26 17:08:56 +01:00
moumar 28056deb66 Fix ZZFX example
ZZFX example did not produce any sound out of the box, fixed by updating
tremolo param.
2025-10-23 23:15:53 +02:00
yaxu 7071dec775 revert 39e2221c29
revert add _processParts()
2025-10-23 16:07:42 +02:00
Alex McLean 3d55567445 Merge branch 'main' of ssh://codeberg.org/uzu/strudel 2025-10-23 15:05:50 +01:00
Alex McLean 39e2221c29 add _processParts() 2025-10-23 15:05:39 +01:00
Alex McLean b8ce920f50 Merge pull request 'Make osc port and host configurable. Changes dependencies.' (#1682) from multiosc into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1682
2025-10-23 15:56:00 +02:00
yaxu ccb5ec1685 Add action to deploy 'beta' version to warm.strudel.cc 2025-10-23 10:41:29 +02:00
yaxu b09230fe90 Update .forgejo/workflows/deploy.yml 2025-10-23 10:40:08 +02:00
yaxu 8f7b439dce Move deploy location to deploy/strudel.cc 2025-10-23 10:39:26 +02:00
Aria c823a37c93 Merge pull request 'Adds back shape to superdough' (#1672) from glossing/strudel:glossing/return-shape-to-sd into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1672
2025-10-23 03:47:30 +02:00
Aria 0c9f535ff5 Merge branch 'main' into glossing/return-shape-to-sd 2025-10-23 03:44:44 +02:00
froos fb5884ab81 Merge pull request 'Fix sampler.mjs githubPath' (#1684) from jeromew/strudel:fix-githubpath into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1684
2025-10-22 22:15:17 +02:00
jeromew ea91d30ce4 Add semicolon 2025-10-22 21:52:53 +02:00
jeromew f0bd5bffaa Fix sampler.mjs githubPath
PR https://codeberg.org/uzu/strudel/pulls/1679 introduced a subtle bug when both other and subpath are empty. The url should not end with '//'
2025-10-22 21:39:08 +02:00
Alex McLean ac37b6a029 Merge pull request 'Fix onPaint for widgets' (#1658) from fix-onpaint into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1658
2025-10-22 16:20:49 +02:00
froos a986688874 Merge pull request 'Fix a bug introduced by #4e17cfbdd6' (#1679) from milliganf/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1679
2025-10-22 15:19:11 +02:00
froos 4ab8c256b2 Merge branch 'main' into main 2025-10-22 15:18:53 +02:00
milliganf 46af6ed9ef Fix a bug introduced by #4e17cfbdd6
When there's no subpath for a Github path, the URL should end with a '/'. Otherwise when we concatenate values on from a sample map it doesn't separate the base URL from the filename.

Signed-off-by: milliganf <m.h.freeson@outlook.com>
2025-10-20 22:30:58 +02:00
Aria 72423c3a25 Adds back shape to superdough 2025-10-18 10:41:33 -05:00
alex ba93bd1bc5 Fix onPaint for widgets 2025-10-15 18:54:02 +01:00
9 changed files with 67 additions and 13 deletions
+37
View File
@@ -0,0 +1,37 @@
name: Build and Deploy to beta (warm.strudel.cc)
on: [workflow_dispatch]
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: docker
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.12.2
- uses: actions/setup-node@v4
with:
node-version: 20
# cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Deploy
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
+2 -2
View File
@@ -1,4 +1,4 @@
name: Build and Deploy name: Build and Deploy to live (strudel.cc)
on: [workflow_dispatch] on: [workflow_dispatch]
@@ -34,4 +34,4 @@ jobs:
apt update && apt install -y rsync apt update && apt install -y rsync
mkdir ~/.ssh mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/strudel.cc
+9
View File
@@ -84,9 +84,18 @@ Pattern.prototype.onPaint = function (painter) {
state.controls.painters = []; state.controls.painters = [];
} }
state.controls.painters.push(painter); state.controls.painters.push(painter);
return state;
}); });
}; };
// TODO - Why isn't this pure deep copy not working?
// Pattern.prototype.onPaint = function (painter) {
// return this.withState((state) => {
// const painters = state.controls.painters ? [...state.controls.painters, painter] : [painter];
// return new State(state.span, { ...state.controls, painters });
// });
// };
Pattern.prototype.getPainters = function () { Pattern.prototype.getPainters = function () {
let painters = []; let painters = [];
this.queryArc(0, 0, { painters }); this.queryArc(0, 0, { painters });
+1 -3
View File
@@ -9,6 +9,7 @@ import readline from 'readline';
import os from 'os'; import os from 'os';
const LOG = !!process.env.LOG || false; const LOG = !!process.env.LOG || false;
const PORT = process.env.PORT || 5432;
const VALID_AUDIO_EXTENSIONS = ['wav', 'mp3', 'ogg']; const VALID_AUDIO_EXTENSIONS = ['wav', 'mp3', 'ogg'];
const isAudioFile = (f) => { const isAudioFile = (f) => {
@@ -54,7 +55,6 @@ async function getBanks(directory, flat = false) {
banks[bank].push(subDir); banks[bank].push(subDir);
return subDir; return subDir;
}); });
banks._base = `http://localhost:5432`;
return { banks, files }; return { banks, files };
} }
@@ -134,8 +134,6 @@ const server = http.createServer(async (req, res) => {
readStream.pipe(res); readStream.pipe(res);
}); });
// eslint-disable-next-line
const PORT = process.env.PORT || 5432;
const IP_ADDRESS = '0.0.0.0'; const IP_ADDRESS = '0.0.0.0';
let IP; let IP;
const networkInterfaces = os.networkInterfaces(); const networkInterfaces = os.networkInterfaces();
+3 -5
View File
@@ -1,4 +1,4 @@
import { getCommonSampleInfo } from './util.mjs'; import { getBaseURL, getCommonSampleInfo } from './util.mjs';
import { registerSound, registerWaveTable } from './index.mjs'; import { registerSound, registerWaveTable } from './index.mjs';
import { getAudioContext } from './audioContext.mjs'; import { getAudioContext } from './audioContext.mjs';
import { getADSRValues, getParamADSR, getPitchEnvelope, getVibratoOscillator } from './helpers.mjs'; import { getADSRValues, getParamADSR, getPitchEnvelope, getVibratoOscillator } from './helpers.mjs';
@@ -129,9 +129,7 @@ function githubPath(base, subpath = '') {
let repo = components.length >= 2 ? components[1] : 'samples'; let repo = components.length >= 2 ? components[1] : 'samples';
let branch = components.length >= 3 ? components[2] : 'main'; let branch = components.length >= 3 ? components[2] : 'main';
let other = components.slice(3); let other = components.slice(3);
if (subpath) { other.push(subpath ? subpath : '');
other.push(subpath);
}
other = other.join('/'); other = other.join('/');
return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`; return `https://raw.githubusercontent.com/${user}/${repo}/${branch}/${other}`;
@@ -213,7 +211,7 @@ export async function fetchSampleMap(url) {
// not a browser // not a browser
return; return;
} }
const base = url.split('/').slice(0, -1).join('/'); const base = getBaseURL(url);
if (typeof fetch === 'undefined') { if (typeof fetch === 'undefined') {
// skip fetch when in node / testing // skip fetch when in node / testing
return; return;
+1
View File
@@ -630,6 +630,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
// effects // effects
coarse !== undefined && chain.push(getWorklet(ac, 'coarse-processor', { coarse })); coarse !== undefined && chain.push(getWorklet(ac, 'coarse-processor', { coarse }));
crush !== undefined && chain.push(getWorklet(ac, 'crush-processor', { crush })); crush !== undefined && chain.push(getWorklet(ac, 'crush-processor', { crush }));
shape !== undefined && chain.push(getWorklet(ac, 'shape-processor', { shape, postgain: shapevol }));
distort !== undefined && chain.push(getDistortion(distort, distortvol, distorttype)); distort !== undefined && chain.push(getDistortion(distort, distortvol, distorttype));
if (tremolosync != null) { if (tremolosync != null) {
+10
View File
@@ -105,3 +105,13 @@ export function getCommonSampleInfo(hapValue, bank) {
const label = `${s}:${index}`; const label = `${s}:${index}`;
return { transpose, url, index, midi, label }; return { transpose, url, index, midi, label };
} }
export const getBaseURL = (url) => {
try {
// For real URLs
return new URL('.', new URL(url)).href.replace(/\/$/, ''); // removes trailing slash
} catch {
// For pseudo URLS
return url.split('/').slice(0, -1).join('/');
}
};
+3 -2
View File
@@ -1,5 +1,5 @@
import { getAudioContext, registerSound } from './index.mjs'; import { getAudioContext, registerSound } from './index.mjs';
import { getCommonSampleInfo } from './util.mjs'; import { getBaseURL, getCommonSampleInfo } from './util.mjs';
import { import {
applyFM, applyFM,
applyParameterModulators, applyParameterModulators,
@@ -190,6 +190,7 @@ export const tables = async (url, frameLen, json, options = {}) => {
if (url.startsWith('local:')) { if (url.startsWith('local:')) {
url = `http://localhost:5432`; url = `http://localhost:5432`;
} }
const base = getBaseURL(url);
if (typeof fetch !== 'function') { if (typeof fetch !== 'function') {
// not a browser // not a browser
return; return;
@@ -200,7 +201,7 @@ export const tables = async (url, frameLen, json, options = {}) => {
} }
return fetch(url) return fetch(url)
.then((res) => res.json()) .then((res) => res.json())
.then((json) => _processTables(json, url, frameLen, options)) .then((json) => _processTables(json, base, frameLen, options))
.catch((error) => { .catch((error) => {
console.error(error); console.error(error);
throw new Error(`error loading "${url}"`); throw new Error(`error loading "${url}"`);
+1 -1
View File
@@ -157,7 +157,7 @@ It has 20 parameters in total, here is a snippet that uses all:
.pitchJump(0) // +/- pitch change after pitchJumpTime .pitchJump(0) // +/- pitch change after pitchJumpTime
.pitchJumpTime(0) // >0 time after pitchJump is applied .pitchJumpTime(0) // >0 time after pitchJump is applied
.lfo(0) // >0 resets slide + pitchJump + sets tremolo speed .lfo(0) // >0 resets slide + pitchJump + sets tremolo speed
.tremolo(0) // 0-1 lfo volume modulation amount .tremolo(0.5) // 0-1 lfo volume modulation amount
//.duration(.2) // overwrite strudel event duration //.duration(.2) // overwrite strudel event duration
//.gain(1) // change volume //.gain(1) // change volume
._scope() // vizualise waveform (not zzfx related) ._scope() // vizualise waveform (not zzfx related)