mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-10 21:28:31 +00:00
delete webdirt
This commit is contained in:
parent
ce09443e48
commit
7466d8a1de
@ -11,5 +11,4 @@ export * from './packages/soundfonts/index.mjs';
|
||||
export * from './packages/tonal/index.mjs';
|
||||
export * from './packages/transpiler/index.mjs';
|
||||
export * from './packages/webaudio/index.mjs';
|
||||
export * from './packages/webdirt/index.mjs';
|
||||
export * from './packages/xen/index.mjs';
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
# @strudel.cycles/webdirt
|
||||
|
||||
This package adds [webdirt](https://github.com/dktr0/WebDirt) support to strudel!
|
||||
|
||||
## Deprecation Note
|
||||
|
||||
This package will not be developed further. Consider using `@strudel.cycles/webaudio` as a replacement.
|
||||
@ -1 +0,0 @@
|
||||
export * from './webdirt.mjs';
|
||||
@ -1,32 +0,0 @@
|
||||
#/bin/sh
|
||||
printf "{\n"
|
||||
dircount=0
|
||||
# for d in $searchRoot/*; do
|
||||
find $1 -mindepth 1 -maxdepth 1 -iname "*" | sort | while read d; do
|
||||
if [ -d "$d" ]
|
||||
then
|
||||
if [ $dircount -ne 0 ]
|
||||
then
|
||||
printf ",\n"
|
||||
fi
|
||||
(( dircount++ ))
|
||||
dirname=`basename $d`
|
||||
printf "\"%s\": [" "$dirname"
|
||||
search2=$searchRoot/$dirname/*.WAV
|
||||
filecount=0
|
||||
find "$d" -iname "*.wav" | sort | while read f; do
|
||||
# for f in $search2; do
|
||||
filename=$(printf %q "$f")
|
||||
basename=${f##*/}
|
||||
if [[ ${basename:0:1} != "." ]]; then
|
||||
if [ $filecount -ne 0 ]; then
|
||||
printf ","
|
||||
fi
|
||||
(( filecount++ ))
|
||||
printf "\"%s/%s\"" "$dirname" "$basename"
|
||||
fi
|
||||
done
|
||||
printf "]"
|
||||
fi
|
||||
done
|
||||
printf "\n}\n"
|
||||
@ -1,41 +0,0 @@
|
||||
{
|
||||
"name": "@strudel.cycles/webdirt",
|
||||
"version": "0.8.0",
|
||||
"description": "WebDirt integration for Strudel",
|
||||
"main": "index.mjs",
|
||||
"type": "module",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/tidalcycles/strudel.git"
|
||||
},
|
||||
"keywords": [
|
||||
"tidalcycles",
|
||||
"strudel",
|
||||
"pattern",
|
||||
"livecoding",
|
||||
"algorave"
|
||||
],
|
||||
"author": "Felix Roos <flix91@gmail.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/tidalcycles/strudel/issues"
|
||||
},
|
||||
"homepage": "https://github.com/tidalcycles/strudel#readme",
|
||||
"dependencies": {
|
||||
"@strudel.cycles/core": "workspace:*",
|
||||
"@strudel.cycles/webaudio": "workspace:*",
|
||||
"WebDirt": "github:dktr0/WebDirt"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^4.3.3",
|
||||
"vitest": "^0.28.0"
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { dependencies } from './package.json';
|
||||
import { resolve } from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [],
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(__dirname, 'index.mjs'),
|
||||
formats: ['es', 'cjs'],
|
||||
fileName: (ext) => ({ es: 'index.mjs', cjs: 'index.js' }[ext]),
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [...Object.keys(dependencies)],
|
||||
},
|
||||
target: 'esnext',
|
||||
},
|
||||
});
|
||||
@ -1,97 +0,0 @@
|
||||
import * as strudel from '@strudel.cycles/core';
|
||||
const { Pattern } = strudel;
|
||||
import * as WebDirt from 'WebDirt';
|
||||
//import { loadBuffer, getLoadedBuffer } from '@strudel.cycles/webaudio';
|
||||
|
||||
let webDirt;
|
||||
|
||||
/*
|
||||
example config:
|
||||
{
|
||||
sampleMapUrl: 'EmuSP12.json',
|
||||
sampleFolder: 'EmuSP12',
|
||||
}
|
||||
*/
|
||||
export function loadWebDirt(config) {
|
||||
webDirt = new WebDirt.WebDirt(config);
|
||||
webDirt.initializeWebAudio();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Uses [webdirt](https://github.com/dktr0/WebDirt) as output.
|
||||
*
|
||||
* <details>
|
||||
* <summary>show supported Webdirt controls</summary>
|
||||
*
|
||||
* - s :: String, -- name of sample bank
|
||||
* - n :: Int, -- number of sample within a bank
|
||||
* - {@link gain} :: Number, -- clamped from 0 to 2; 1 is default and full-scale
|
||||
* - overgain :: Number, -- additional gain added to gain to go past clamp at 2
|
||||
* - {@link pan} :: Number, -- range: 0 to 1
|
||||
* - nudge :: Number, -- nudge the time of the sample forwards/backwards in seconds
|
||||
* - {@link speed} :: Number, -- speed / pitch of the sample
|
||||
* - {@link unit} :: String
|
||||
* - note :: Number, -- pitch offset in semitones
|
||||
* - {@link begin} :: Number, -- cut from sample start, normalized
|
||||
* - {@link end} :: Number, -- cut from sample end, normalized
|
||||
* - {@link cut} :: Int, -- samples with same cut number will interupt each other
|
||||
* - {@link cutoff} :: Number, -- lowpass filter frequency
|
||||
* - {@link resonance} :: Number, -- lowpass filter resonance
|
||||
* - {@link hcutoff} :: Number, -- highpass filter frequency
|
||||
* - {@link hresonance} :: Number, -- highpass filter resonance
|
||||
* - {@link bandf} :: Number, -- bandpass filter frequency
|
||||
* - {@link bandq} :: Number, -- bandpass filter resonance
|
||||
* - {@link vowel} :: String, -- name of vowel ('a' | 'e' | 'i' | 'o' | 'u')
|
||||
* - delay :: Number, -- delay wet/dry mix
|
||||
* - delaytime :: Number, -- delay time in seconds
|
||||
* - delayfeedback :: Number, -- delay feedback
|
||||
* - {@link loop} :: Number, -- loop sample n times (relative to sample length)
|
||||
* - {@link crush} :: Number, -- bitcrusher (currently not working)
|
||||
* - {@link coarse} :: Number, -- coarse effect (currently not working)
|
||||
* - {@link shape} :: Number, -- (currently not working)
|
||||
|
||||
*
|
||||
* </details>
|
||||
*
|
||||
* @name webdirt
|
||||
* @memberof Pattern
|
||||
* @returns Pattern
|
||||
* @example
|
||||
* s("bd*2 hh sd hh").n("<0 1>").webdirt()
|
||||
* @noAutocomplete
|
||||
*/
|
||||
Pattern.prototype.webdirt = function () {
|
||||
throw new Error('webdirt support has been dropped..');
|
||||
// create a WebDirt object and initialize Web Audio context
|
||||
/* return this.onTrigger(async (time, e, currentTime) => {
|
||||
if (!webDirt) {
|
||||
throw new Error('WebDirt not initialized!');
|
||||
}
|
||||
const deadline = time - currentTime;
|
||||
const { s, n = 0, ...rest } = e.value || {};
|
||||
if (!s) {
|
||||
console.warn('Pattern.webdirt: no "s" was set!');
|
||||
}
|
||||
const samples = getLoadedSamples();
|
||||
if (!samples?.[s]) {
|
||||
// try default samples
|
||||
webDirt.playSample({ s, n, ...rest }, deadline);
|
||||
return;
|
||||
}
|
||||
if (!samples?.[s]) {
|
||||
console.warn(`Pattern.webdirt: sample "${s}" not found in loaded samples`, samples);
|
||||
} else {
|
||||
const bank = samples[s];
|
||||
const sampleUrl = bank[n % bank.length];
|
||||
const buffer = getLoadedBuffer(sampleUrl);
|
||||
if (!buffer) {
|
||||
console.log(`Pattern.webdirt: load ${s}:${n} from ${sampleUrl}`);
|
||||
loadBuffer(sampleUrl, webDirt.ac);
|
||||
} else {
|
||||
const msg = { buffer: { buffer }, ...rest };
|
||||
webDirt.playSample(msg, deadline);
|
||||
}
|
||||
}
|
||||
}); */
|
||||
};
|
||||
@ -217,10 +217,6 @@
|
||||
"webaudioOutputTrigger"
|
||||
],
|
||||
"/home/felix/projects/strudel/packages/webaudio/index.mjs": [],
|
||||
"/home/felix/projects/strudel/packages/webdirt/webdirt.mjs": [
|
||||
"loadWebDirt"
|
||||
],
|
||||
"/home/felix/projects/strudel/packages/webdirt/index.mjs": [],
|
||||
"/home/felix/projects/strudel/packages/xen/xen.mjs": [
|
||||
"edo",
|
||||
"xen",
|
||||
|
||||
@ -54,7 +54,7 @@ These packages provide bindings for different ways to output strudel patterns:
|
||||
|
||||
- [eval](https://www.npmjs.com/package/@strudel.cycles/eval): old code transpiler
|
||||
- [tone](https://www.npmjs.com/package/@strudel.cycles/tone): bindings for Tone.js instruments and effects
|
||||
- [webdirt](https://github.com/tidalcycles/strudel/tree/main/packages/webdirt): webdirt bindings, replaced by webaudio package
|
||||
- [webdirt](https://www.npmjs.com/package/@strudel.cycles/webdirt): webdirt bindings, replaced by webaudio package
|
||||
|
||||
## Tools
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user