diff --git a/package-lock.json b/package-lock.json index 0d4ff7b1..0e700319 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2255,6 +2255,10 @@ "resolved": "packages/webaudio", "link": true }, + "node_modules/@strudel.cycles/webdirt": { + "resolved": "packages/webdirt", + "link": true + }, "node_modules/@strudel.cycles/xen": { "resolved": "packages/xen", "link": true @@ -10815,6 +10819,11 @@ "defaults": "^1.0.3" } }, + "node_modules/WebDirt": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/dktr0/WebDirt.git#c3aee2c933c4889ee664a836db8c6436af9e867b", + "license": "ISC" + }, "node_modules/webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", @@ -11271,7 +11280,7 @@ }, "packages/eval": { "name": "@strudel.cycles/eval", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0", @@ -11298,22 +11307,22 @@ }, "packages/midi": { "name": "@strudel.cycles/midi", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/tone": "^0.1.0", + "@strudel.cycles/tone": "^0.1.1", "tone": "^14.7.77", "webmidi": "^2.5.2" } }, "packages/mini": { "name": "@strudel.cycles/mini", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0", - "@strudel.cycles/eval": "^0.1.0", - "@strudel.cycles/tone": "^0.1.0" + "@strudel.cycles/eval": "^0.1.1", + "@strudel.cycles/tone": "^0.1.1" } }, "packages/osc": { @@ -11326,14 +11335,14 @@ }, "packages/react": { "name": "@strudel.cycles/react", - "version": "0.1.1", + "version": "0.1.2", "license": "AGPL-3.0-or-later", "peer": true, "dependencies": { "@codemirror/lang-javascript": "^0.19.0", "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.0", - "@strudel.cycles/tone": "^0.1.0", + "@strudel.cycles/eval": "^0.1.1", + "@strudel.cycles/tone": "^0.1.1", "react-codemirror6": "^1.1.0", "react-hook-inview": "^4.5.0" }, @@ -11407,7 +11416,7 @@ }, "packages/tonal": { "name": "@strudel.cycles/tonal", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0", @@ -11432,7 +11441,7 @@ }, "packages/tone": { "name": "@strudel.cycles/tone", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0", @@ -11443,15 +11452,24 @@ }, "packages/webaudio": { "name": "@strudel.cycles/webaudio", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0" } }, + "packages/webdirt": { + "name": "@strudel.cycles/webdirt", + "version": "0.1.0", + "license": "AGPL-3.0-or-later", + "dependencies": { + "@strudel.cycles/core": "^0.1.0", + "WebDirt": "github:dktr0/WebDirt" + } + }, "packages/xen": { "name": "@strudel.cycles/xen", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "^0.1.0" @@ -13281,7 +13299,7 @@ "@strudel.cycles/midi": { "version": "file:packages/midi", "requires": { - "@strudel.cycles/tone": "^0.1.0", + "@strudel.cycles/tone": "^0.1.1", "tone": "^14.7.77", "webmidi": "^2.5.2" } @@ -13290,8 +13308,8 @@ "version": "file:packages/mini", "requires": { "@strudel.cycles/core": "^0.1.0", - "@strudel.cycles/eval": "^0.1.0", - "@strudel.cycles/tone": "^0.1.0" + "@strudel.cycles/eval": "^0.1.1", + "@strudel.cycles/tone": "^0.1.1" } }, "@strudel.cycles/osc": { @@ -13305,8 +13323,8 @@ "requires": { "@codemirror/lang-javascript": "^0.19.0", "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.0", - "@strudel.cycles/tone": "^0.1.0", + "@strudel.cycles/eval": "^0.1.1", + "@strudel.cycles/tone": "^0.1.1", "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "@vitejs/plugin-react": "^1.3.0", @@ -13401,6 +13419,13 @@ "@strudel.cycles/core": "^0.1.0" } }, + "@strudel.cycles/webdirt": { + "version": "file:packages/webdirt", + "requires": { + "@strudel.cycles/core": "^0.1.0", + "WebDirt": "github:dktr0/WebDirt" + } + }, "@strudel.cycles/xen": { "version": "file:packages/xen", "requires": { @@ -18362,8 +18387,8 @@ "requires": { "@codemirror/lang-javascript": "^0.19.0", "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.0", - "@strudel.cycles/tone": "^0.1.0", + "@strudel.cycles/eval": "^0.1.1", + "@strudel.cycles/tone": "^0.1.1", "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "@vitejs/plugin-react": "^1.3.0", @@ -20004,6 +20029,10 @@ "defaults": "^1.0.3" } }, + "WebDirt": { + "version": "git+ssh://git@github.com/dktr0/WebDirt.git#c3aee2c933c4889ee664a836db8c6436af9e867b", + "from": "WebDirt@github:dktr0/WebDirt" + }, "webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", diff --git a/packages/webdirt/README:md b/packages/webdirt/README:md new file mode 100644 index 00000000..807efab5 --- /dev/null +++ b/packages/webdirt/README:md @@ -0,0 +1,10 @@ +# @strudel.cycles/webdirt + +This package adds [webdirt](https://github.com/dktr0/WebDirt) support to strudel! + +## Dev Notes + +Add default samples to repl: + +1. move samples to public folder +2. run `./makeSampleMap.sh ../../repl/public/EmuSP12 > ../../repl/public/EmuSP12.json` diff --git a/packages/webdirt/index.mjs b/packages/webdirt/index.mjs new file mode 100644 index 00000000..edafebd8 --- /dev/null +++ b/packages/webdirt/index.mjs @@ -0,0 +1 @@ +export * from './webdirt.mjs'; diff --git a/packages/webdirt/makeSampleMap.sh b/packages/webdirt/makeSampleMap.sh new file mode 100755 index 00000000..7b399b6e --- /dev/null +++ b/packages/webdirt/makeSampleMap.sh @@ -0,0 +1,32 @@ +#/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" diff --git a/packages/webdirt/package.json b/packages/webdirt/package.json new file mode 100644 index 00000000..62cb55bc --- /dev/null +++ b/packages/webdirt/package.json @@ -0,0 +1,28 @@ +{ + "name": "@strudel.cycles/webdirt", + "version": "0.1.0", + "description": "WebDirt integration for Strudel", + "main": "index.mjs", + "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/tidalcycles/strudel.git" + }, + "keywords": [ + "tidalcycles", + "strudel", + "pattern", + "livecoding", + "algorave" + ], + "author": "Felix Roos ", + "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": "^0.1.0", + "WebDirt": "github:dktr0/WebDirt" + } +} diff --git a/packages/webdirt/webdirt.mjs b/packages/webdirt/webdirt.mjs new file mode 100644 index 00000000..d249d949 --- /dev/null +++ b/packages/webdirt/webdirt.mjs @@ -0,0 +1,32 @@ +import * as strudel from '@strudel.cycles/core'; +const { Pattern } = strudel; +import * as WebDirt from 'WebDirt'; + +let webDirt; + +/* +example config: +{ + sampleMapUrl: 'EmuSP12.json', + sampleFolder: 'EmuSP12', +} +*/ +export function loadWebDirt(config) { + webDirt = new WebDirt.WebDirt(config); + webDirt.initializeWebAudio(); +} + +Pattern.prototype.webdirt = function () { + // create a WebDirt object and initialize Web Audio context + return this._withHap((hap) => { + const onTrigger = (time, e, currentTime) => { + if (!webDirt) { + throw new Error('WebDirt not initialized!'); + } + const deadline = time - currentTime; + const { s, n = 0 } = e.value; + webDirt.playSample({ s, n }, deadline); + }; + return hap.setContext({ ...hap.context, onTrigger }); + }); +}; diff --git a/repl/public/EmuSP12.json b/repl/public/EmuSP12.json new file mode 100644 index 00000000..69746bed --- /dev/null +++ b/repl/public/EmuSP12.json @@ -0,0 +1,16 @@ +{ +"bd": ["bd/Bassdrum-01.wav","bd/Bassdrum-02.wav","bd/Bassdrum-03.wav","bd/Bassdrum-04.wav","bd/Bassdrum-05.wav","bd/Bassdrum-06.wav","bd/Bassdrum-07.wav","bd/Bassdrum-08.wav","bd/Bassdrum-09.wav","bd/Bassdrum-10.wav","bd/Bassdrum-11.wav","bd/Bassdrum-12.wav","bd/Bassdrum-13.wav","bd/Bassdrum-14.wav"], +"cb": ["cb/Cowbell.wav"], +"cp": ["cp/Clap.wav"], +"cr": ["cr/Crash.wav"], +"hh": ["hh/Hat Closed-01.wav","hh/Hat Closed-02.wav"], +"ht": ["ht/Tom H-01.wav","ht/Tom H-02.wav","ht/Tom H-03.wav","ht/Tom H-04.wav","ht/Tom H-05.wav","ht/Tom H-06.wav"], +"lt": ["lt/Tom L-01.wav","lt/Tom L-02.wav","lt/Tom L-03.wav","lt/Tom L-04.wav","lt/Tom L-05.wav","lt/Tom L-06.wav"], +"misc": ["misc/Metal-01.wav","misc/Metal-02.wav","misc/Metal-03.wav","misc/Scratch.wav","misc/Shot-01.wav","misc/Shot-02.wav","misc/Shot-03.wav"], +"mt": ["mt/Tom M-01.wav","mt/Tom M-02.wav","mt/Tom M-03.wav","mt/Tom M-05.wav"], +"oh": ["oh/Hhopen1.wav"], +"perc": ["perc/Blow1.wav"], +"rd": ["rd/Ride.wav"], +"rim": ["rim/zRim Shot-01.wav","rim/zRim Shot-02.wav"], +"sd": ["sd/Snaredrum-01.wav","sd/Snaredrum-02.wav","sd/Snaredrum-03.wav","sd/Snaredrum-04.wav","sd/Snaredrum-05.wav","sd/Snaredrum-06.wav","sd/Snaredrum-07.wav","sd/Snaredrum-08.wav","sd/Snaredrum-09.wav","sd/Snaredrum-10.wav","sd/Snaredrum-11.wav","sd/Snaredrum-12.wav","sd/Snaredrum-13.wav","sd/Snaredrum-14.wav","sd/Snaredrum-15.wav","sd/Snaredrum-16.wav","sd/Snaredrum-17.wav","sd/Snaredrum-18.wav","sd/Snaredrum-19.wav","sd/Snaredrum-20.wav","sd/Snaredrum-21.wav"] +} diff --git a/repl/public/EmuSP12/bd/Bassdrum-01.wav b/repl/public/EmuSP12/bd/Bassdrum-01.wav new file mode 100644 index 00000000..48e93676 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-01.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-02.wav b/repl/public/EmuSP12/bd/Bassdrum-02.wav new file mode 100644 index 00000000..52cd0afc Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-02.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-03.wav b/repl/public/EmuSP12/bd/Bassdrum-03.wav new file mode 100644 index 00000000..5c524ad7 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-03.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-04.wav b/repl/public/EmuSP12/bd/Bassdrum-04.wav new file mode 100644 index 00000000..9f9365d4 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-04.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-05.wav b/repl/public/EmuSP12/bd/Bassdrum-05.wav new file mode 100644 index 00000000..a4c80945 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-05.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-06.wav b/repl/public/EmuSP12/bd/Bassdrum-06.wav new file mode 100644 index 00000000..283d2f76 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-06.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-07.wav b/repl/public/EmuSP12/bd/Bassdrum-07.wav new file mode 100644 index 00000000..24f26186 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-07.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-08.wav b/repl/public/EmuSP12/bd/Bassdrum-08.wav new file mode 100644 index 00000000..51661252 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-08.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-09.wav b/repl/public/EmuSP12/bd/Bassdrum-09.wav new file mode 100644 index 00000000..3c6487c3 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-09.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-10.wav b/repl/public/EmuSP12/bd/Bassdrum-10.wav new file mode 100644 index 00000000..34a9b924 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-10.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-11.wav b/repl/public/EmuSP12/bd/Bassdrum-11.wav new file mode 100644 index 00000000..256555c2 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-11.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-12.wav b/repl/public/EmuSP12/bd/Bassdrum-12.wav new file mode 100644 index 00000000..8c29f046 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-12.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-13.wav b/repl/public/EmuSP12/bd/Bassdrum-13.wav new file mode 100644 index 00000000..a0291102 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-13.wav differ diff --git a/repl/public/EmuSP12/bd/Bassdrum-14.wav b/repl/public/EmuSP12/bd/Bassdrum-14.wav new file mode 100644 index 00000000..eecea2f1 Binary files /dev/null and b/repl/public/EmuSP12/bd/Bassdrum-14.wav differ diff --git a/repl/public/EmuSP12/cb/Cowbell.wav b/repl/public/EmuSP12/cb/Cowbell.wav new file mode 100644 index 00000000..470763c6 Binary files /dev/null and b/repl/public/EmuSP12/cb/Cowbell.wav differ diff --git a/repl/public/EmuSP12/cp/Clap.wav b/repl/public/EmuSP12/cp/Clap.wav new file mode 100644 index 00000000..27517d79 Binary files /dev/null and b/repl/public/EmuSP12/cp/Clap.wav differ diff --git a/repl/public/EmuSP12/cr/Crash.wav b/repl/public/EmuSP12/cr/Crash.wav new file mode 100644 index 00000000..6d1e2939 Binary files /dev/null and b/repl/public/EmuSP12/cr/Crash.wav differ diff --git a/repl/public/EmuSP12/hh/Hat Closed-01.wav b/repl/public/EmuSP12/hh/Hat Closed-01.wav new file mode 100644 index 00000000..1f18ccac Binary files /dev/null and b/repl/public/EmuSP12/hh/Hat Closed-01.wav differ diff --git a/repl/public/EmuSP12/hh/Hat Closed-02.wav b/repl/public/EmuSP12/hh/Hat Closed-02.wav new file mode 100644 index 00000000..cc40c03f Binary files /dev/null and b/repl/public/EmuSP12/hh/Hat Closed-02.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-01.wav b/repl/public/EmuSP12/ht/Tom H-01.wav new file mode 100644 index 00000000..82706785 Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-01.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-02.wav b/repl/public/EmuSP12/ht/Tom H-02.wav new file mode 100644 index 00000000..9cfe221c Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-02.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-03.wav b/repl/public/EmuSP12/ht/Tom H-03.wav new file mode 100644 index 00000000..a6eef5cd Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-03.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-04.wav b/repl/public/EmuSP12/ht/Tom H-04.wav new file mode 100644 index 00000000..8c38b3b1 Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-04.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-05.wav b/repl/public/EmuSP12/ht/Tom H-05.wav new file mode 100644 index 00000000..2e0899d2 Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-05.wav differ diff --git a/repl/public/EmuSP12/ht/Tom H-06.wav b/repl/public/EmuSP12/ht/Tom H-06.wav new file mode 100644 index 00000000..9dccec23 Binary files /dev/null and b/repl/public/EmuSP12/ht/Tom H-06.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-01.wav b/repl/public/EmuSP12/lt/Tom L-01.wav new file mode 100644 index 00000000..cfa4067f Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-01.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-02.wav b/repl/public/EmuSP12/lt/Tom L-02.wav new file mode 100644 index 00000000..68624f5f Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-02.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-03.wav b/repl/public/EmuSP12/lt/Tom L-03.wav new file mode 100644 index 00000000..f1439d8c Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-03.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-04.wav b/repl/public/EmuSP12/lt/Tom L-04.wav new file mode 100644 index 00000000..46d614a0 Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-04.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-05.wav b/repl/public/EmuSP12/lt/Tom L-05.wav new file mode 100644 index 00000000..c9566585 Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-05.wav differ diff --git a/repl/public/EmuSP12/lt/Tom L-06.wav b/repl/public/EmuSP12/lt/Tom L-06.wav new file mode 100644 index 00000000..c1edf374 Binary files /dev/null and b/repl/public/EmuSP12/lt/Tom L-06.wav differ diff --git a/repl/public/EmuSP12/misc/Metal-01.wav b/repl/public/EmuSP12/misc/Metal-01.wav new file mode 100644 index 00000000..0f306e70 Binary files /dev/null and b/repl/public/EmuSP12/misc/Metal-01.wav differ diff --git a/repl/public/EmuSP12/misc/Metal-02.wav b/repl/public/EmuSP12/misc/Metal-02.wav new file mode 100644 index 00000000..8a05af0e Binary files /dev/null and b/repl/public/EmuSP12/misc/Metal-02.wav differ diff --git a/repl/public/EmuSP12/misc/Metal-03.wav b/repl/public/EmuSP12/misc/Metal-03.wav new file mode 100644 index 00000000..0ae2ba80 Binary files /dev/null and b/repl/public/EmuSP12/misc/Metal-03.wav differ diff --git a/repl/public/EmuSP12/misc/Scratch.wav b/repl/public/EmuSP12/misc/Scratch.wav new file mode 100644 index 00000000..11bde1a5 Binary files /dev/null and b/repl/public/EmuSP12/misc/Scratch.wav differ diff --git a/repl/public/EmuSP12/misc/Shot-01.wav b/repl/public/EmuSP12/misc/Shot-01.wav new file mode 100644 index 00000000..e4ecfef3 Binary files /dev/null and b/repl/public/EmuSP12/misc/Shot-01.wav differ diff --git a/repl/public/EmuSP12/misc/Shot-02.wav b/repl/public/EmuSP12/misc/Shot-02.wav new file mode 100644 index 00000000..80f67cb2 Binary files /dev/null and b/repl/public/EmuSP12/misc/Shot-02.wav differ diff --git a/repl/public/EmuSP12/misc/Shot-03.wav b/repl/public/EmuSP12/misc/Shot-03.wav new file mode 100644 index 00000000..0cc84c28 Binary files /dev/null and b/repl/public/EmuSP12/misc/Shot-03.wav differ diff --git a/repl/public/EmuSP12/mt/Tom M-01.wav b/repl/public/EmuSP12/mt/Tom M-01.wav new file mode 100644 index 00000000..a650caf5 Binary files /dev/null and b/repl/public/EmuSP12/mt/Tom M-01.wav differ diff --git a/repl/public/EmuSP12/mt/Tom M-02.wav b/repl/public/EmuSP12/mt/Tom M-02.wav new file mode 100644 index 00000000..cbd7d16c Binary files /dev/null and b/repl/public/EmuSP12/mt/Tom M-02.wav differ diff --git a/repl/public/EmuSP12/mt/Tom M-03.wav b/repl/public/EmuSP12/mt/Tom M-03.wav new file mode 100644 index 00000000..e5c4b133 Binary files /dev/null and b/repl/public/EmuSP12/mt/Tom M-03.wav differ diff --git a/repl/public/EmuSP12/mt/Tom M-05.wav b/repl/public/EmuSP12/mt/Tom M-05.wav new file mode 100644 index 00000000..841cac02 Binary files /dev/null and b/repl/public/EmuSP12/mt/Tom M-05.wav differ diff --git a/repl/public/EmuSP12/oh/Hhopen1.wav b/repl/public/EmuSP12/oh/Hhopen1.wav new file mode 100644 index 00000000..73811991 Binary files /dev/null and b/repl/public/EmuSP12/oh/Hhopen1.wav differ diff --git a/repl/public/EmuSP12/perc/Blow1.wav b/repl/public/EmuSP12/perc/Blow1.wav new file mode 100644 index 00000000..8021d0d1 Binary files /dev/null and b/repl/public/EmuSP12/perc/Blow1.wav differ diff --git a/repl/public/EmuSP12/rd/Ride.wav b/repl/public/EmuSP12/rd/Ride.wav new file mode 100644 index 00000000..da0e33eb Binary files /dev/null and b/repl/public/EmuSP12/rd/Ride.wav differ diff --git a/repl/public/EmuSP12/rim/zRim Shot-01.wav b/repl/public/EmuSP12/rim/zRim Shot-01.wav new file mode 100644 index 00000000..98088cf2 Binary files /dev/null and b/repl/public/EmuSP12/rim/zRim Shot-01.wav differ diff --git a/repl/public/EmuSP12/rim/zRim Shot-02.wav b/repl/public/EmuSP12/rim/zRim Shot-02.wav new file mode 100644 index 00000000..c0f1a12d Binary files /dev/null and b/repl/public/EmuSP12/rim/zRim Shot-02.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-01.wav b/repl/public/EmuSP12/sd/Snaredrum-01.wav new file mode 100644 index 00000000..008bbf1d Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-01.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-02.wav b/repl/public/EmuSP12/sd/Snaredrum-02.wav new file mode 100644 index 00000000..4711ff70 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-02.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-03.wav b/repl/public/EmuSP12/sd/Snaredrum-03.wav new file mode 100644 index 00000000..643cf237 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-03.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-04.wav b/repl/public/EmuSP12/sd/Snaredrum-04.wav new file mode 100644 index 00000000..bb8c4c34 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-04.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-05.wav b/repl/public/EmuSP12/sd/Snaredrum-05.wav new file mode 100644 index 00000000..678db12e Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-05.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-06.wav b/repl/public/EmuSP12/sd/Snaredrum-06.wav new file mode 100644 index 00000000..a89a1d60 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-06.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-07.wav b/repl/public/EmuSP12/sd/Snaredrum-07.wav new file mode 100644 index 00000000..fdc1fb03 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-07.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-08.wav b/repl/public/EmuSP12/sd/Snaredrum-08.wav new file mode 100644 index 00000000..324eafac Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-08.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-09.wav b/repl/public/EmuSP12/sd/Snaredrum-09.wav new file mode 100644 index 00000000..35b617d7 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-09.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-10.wav b/repl/public/EmuSP12/sd/Snaredrum-10.wav new file mode 100644 index 00000000..85d13e91 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-10.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-11.wav b/repl/public/EmuSP12/sd/Snaredrum-11.wav new file mode 100644 index 00000000..d296fea5 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-11.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-12.wav b/repl/public/EmuSP12/sd/Snaredrum-12.wav new file mode 100644 index 00000000..b4fc9ca4 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-12.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-13.wav b/repl/public/EmuSP12/sd/Snaredrum-13.wav new file mode 100644 index 00000000..fbe745f9 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-13.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-14.wav b/repl/public/EmuSP12/sd/Snaredrum-14.wav new file mode 100644 index 00000000..fd321482 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-14.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-15.wav b/repl/public/EmuSP12/sd/Snaredrum-15.wav new file mode 100644 index 00000000..703a23cd Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-15.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-16.wav b/repl/public/EmuSP12/sd/Snaredrum-16.wav new file mode 100644 index 00000000..ef6c1f9c Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-16.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-17.wav b/repl/public/EmuSP12/sd/Snaredrum-17.wav new file mode 100644 index 00000000..df7e282e Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-17.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-18.wav b/repl/public/EmuSP12/sd/Snaredrum-18.wav new file mode 100644 index 00000000..0950c300 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-18.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-19.wav b/repl/public/EmuSP12/sd/Snaredrum-19.wav new file mode 100644 index 00000000..46b8e0d8 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-19.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-20.wav b/repl/public/EmuSP12/sd/Snaredrum-20.wav new file mode 100644 index 00000000..4c211a7c Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-20.wav differ diff --git a/repl/public/EmuSP12/sd/Snaredrum-21.wav b/repl/public/EmuSP12/sd/Snaredrum-21.wav new file mode 100644 index 00000000..246ea401 Binary files /dev/null and b/repl/public/EmuSP12/sd/Snaredrum-21.wav differ diff --git a/repl/src/App.jsx b/repl/src/App.jsx index 3480a27d..ac49578e 100644 --- a/repl/src/App.jsx +++ b/repl/src/App.jsx @@ -12,9 +12,13 @@ import React, { useCallback, useLayoutEffect, useRef, useState } from 'react'; import './App.css'; import logo from './logo.svg'; import * as tunes from './tunes.mjs'; +import * as WebDirt from 'WebDirt'; +import { loadWebDirt } from '@strudel.cycles/webdirt'; + evalScope( Tone, controls, + { WebDirt }, import('@strudel.cycles/core'), import('@strudel.cycles/tone'), import('@strudel.cycles/tonal'), @@ -23,8 +27,14 @@ evalScope( import('@strudel.cycles/xen'), import('@strudel.cycles/webaudio'), import('@strudel.cycles/osc'), + import('@strudel.cycles/webdirt'), ); +loadWebDirt({ + sampleMapUrl: 'EmuSP12.json', + sampleFolder: 'EmuSP12', +}); + const initialUrl = window.location.href; const codeParam = window.location.href.split('#')[1]; let decoded;