This repository was archived by the owner on Jun 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
supradough poc #1362
Open
felixroos
wants to merge
53
commits into
main
Choose a base branch
from
supradough
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
supradough poc #1362
Changes from 18 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
483843b
begin supradough
felixroos 5336569
proper lpf mapping + remove redundant worklet params,
felixroos 5129fa6
fix click
daslyfe ff4b7ca
fix volume
daslyfe 930dabe
dough as a singleton worklet with voice allocation
felixroos 2cbd35f
refactor: make webaudio glue as minimal as possible
felixroos f0e6c54
handle invalid spawns + remove logs
felixroos ccec7e7
poc: render pattern audio with node script
felixroos 87598e1
coarse
felixroos 0cc18a6
crush (might be wrong)
felixroos 623bf93
panning
felixroos 9ed690c
pulse osc + velocity
felixroos 794bf86
distort
felixroos 6cf0b6f
hpf + bpf
felixroos e4cd5dc
rough filter envelope implementation
felixroos 998a010
better filter envelopes
felixroos ccc90d5
ignore dough-export to fix checks
felixroos 43c05cb
move supradough to separate package
felixroos 49f38ae
remove log
felixroos 1dac696
feedback delay (still hard coded feedback / time values)
felixroos d743570
set delay time and feedback from voice
felixroos e54449f
white brown pink noise + crackle alias for dust
felixroos 77463a1
add square alias for pulse
felixroos b000f22
fm
felixroos 2f2bf5b
fix: note2midi for notes without octave
felixroos 5988e3d
fix: hot reloading for dough.mjs (see comment)
felixroos ab052ce
fix: polyblepped sawtooth + fm = death
felixroos ac7ee37
pitch envelope
felixroos 0f2aa95
half working samples
felixroos 356d436
fix: scheduling + sample playback
felixroos 55aef18
buffers can now be repitched (still with aliasing)
felixroos ec9109d
exponential lerp
daslyfe 1167fdb
Merge branch 'supradough' of https://github.com/tidalcycles/strudel i…
daslyfe 181e51e
adjustable envelope curves
daslyfe 73ef43d
move things around in init
felixroos 1081fc6
refactor: stereo sample support + channelwise fx
felixroos d1b6b6b
fix: hpf
felixroos 3ac0fdf
rudimentary sample map loading (doughsamples)
felixroos aeaed50
gaincurve
daslyfe 3d30007
supersaw
daslyfe e825473
apply speed to synths and samples + add normalize flag (for fit)
felixroos c9f494d
fix: node export
felixroos e99adff
vibrato
felixroos 3963b80
fix: calling doughsamples multiple times
felixroos 7e8206d
pitched delay
daslyfe 43504d1
add chorus
daslyfe bbd7ed0
lazy sample loading
felixroos 5cbd38a
improve filter performance making it accept hz directly
felixroos 3caf08e
up latency
felixroos 14193ab
improve export: add stereo + measure performance + add bigger pattern…
felixroos 30f7127
Merge remote-tracking branch 'origin/main' into supradough
felixroos 8363ba5
format
felixroos 239987a
snapshot
felixroos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| pattern.wav |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # supradough | ||
|
|
||
| platform agnostic synth and sampler intended for live coding. a reimplementation of superdough. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // this is a poc of how a pattern can be rendered as a wav file using node | ||
| // run via: node dough-export.mjs | ||
| import fs from 'node:fs'; | ||
| import WavEncoder from 'wav-encoder'; | ||
| import { evalScope } from '@strudel/core'; | ||
| import { miniAllStrings } from '@strudel/mini'; | ||
| import { Dough } from './dough.mjs'; | ||
|
|
||
| await evalScope( | ||
| import('@strudel/core'), | ||
| import('@strudel/mini'), | ||
| import('@strudel/tonal'), | ||
| // import('@strudel/tonal'), | ||
| ); | ||
|
|
||
| miniAllStrings(); // allows using single quotes for mini notation / skip transpilation | ||
|
|
||
| let sampleRate = 48000, | ||
| cps = 0.5; | ||
|
|
||
| let pat = note('[c e g b]*3') | ||
| .add(note(7)) | ||
| .lpf(sine.rangex(200, 4000).slow(2)) | ||
| .lpq(0.3) | ||
| .s('<pulse saw tri>*2') | ||
| .att(0.01) | ||
| .rel(0.2) | ||
| .clip(2) | ||
| .delay(0.5) | ||
| .jux(rev) | ||
| .sometimes(add(note(12))) | ||
| .gain(0.25) | ||
| .slow(1 / cps); | ||
|
|
||
| let cycles = 4; | ||
| let seconds = cycles + 1; // 1s release tail | ||
| const haps = pat.queryArc(0, cycles); | ||
|
|
||
| const dough = new Dough(sampleRate); | ||
|
|
||
| console.log('spawn voices...'); | ||
| haps.forEach((hap) => { | ||
| hap.value._begin = Number(hap.whole.begin); | ||
| hap.value._duration = hap.duration / cps; | ||
| dough.scheduleSpawn(hap.value); | ||
| }); | ||
| console.log(`render ${seconds}s long buffer...`); | ||
| const buffer = new Float32Array(seconds * sampleRate); | ||
| while (dough.t <= buffer.length) { | ||
| buffer[dough.t] = dough.update(); | ||
| } | ||
| console.log('done!'); | ||
|
|
||
| const patternAudio = { | ||
| sampleRate, | ||
| channelData: [buffer], | ||
| }; | ||
|
|
||
| WavEncoder.encode(patternAudio).then((buffer) => { | ||
| fs.writeFileSync('pattern.wav', new Float32Array(buffer)); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { Dough } from './dough.mjs'; | ||
|
|
||
| const clamp = (num, min, max) => Math.min(Math.max(num, min), max); | ||
|
|
||
| class DoughProcessor extends AudioWorkletProcessor { | ||
| constructor() { | ||
| super(); | ||
| this.dough = new Dough(sampleRate, currentTime); | ||
| this.port.onmessage = (event) => this.dough.scheduleSpawn(event.data); | ||
| } | ||
| process(inputs, outputs, params) { | ||
| if (this.disconnected) { | ||
| return false; | ||
| } | ||
| const output = outputs[0]; | ||
| for (let i = 0; i < output[0].length; i++) { | ||
| this.dough.update(); | ||
| for (let c = 0; c < output.length; c++) { | ||
| //prevent speaker blowout via clipping if threshold exceeds | ||
| output[c][i] = clamp(this.dough.channels[c], -1, 1); | ||
| } | ||
| } | ||
| return true; // keep the audio processing going | ||
| } | ||
| } | ||
|
|
||
| registerProcessor('dough-processor', DoughProcessor); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've added this to be able to register worklets from the outside without depending on them from superdough