Skip to content
Open
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ multi-voice mixes.
fraction of each half-bin where pull toward the target decreases, in `0..=1`.
The default is 0, which applies full pull across the whole bin.

`resynthesis.correction.vibrato_preserve` sets the fraction of 4..=8 Hz
vibrato that bypasses correction, in `0..=1`. The default is 0. At 1,
correction moves the mean pitch to the target note and keeps natural
vibrato, also at zero retune time.

`resynthesis.dry_mix` sets the dry fraction at the resynthesis stage. The
dry path starts after Warm and has a delay of 1,593 frames. All six reverb
modes keep the stereo dry signal.
Expand Down Expand Up @@ -579,8 +584,9 @@ and show enums as string literals. To change the configuration, do these steps:

If a required field is absent or a value is not valid, the call throws a
JavaScript `Error`. If an optional field is absent or `undefined`, it gets its
default. `resynthesis.correction.humanize` and
`resynthesis.correction.flexTune` default to 0, and
default. `resynthesis.correction.humanize`,
`resynthesis.correction.flexTune` and
`resynthesis.correction.vibratoPreserve` default to 0, and
`resynthesis.harmony.voices` defaults to 4. The conversion ignores extra object
properties. The generated declarations contain the parameter documentation from
the Rust types.
Expand Down
13 changes: 13 additions & 0 deletions scripts/verify-pack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,13 @@ function verifyRuntimeImport(consumerDir, packageName) {
"const initialConfig = rootModule.defaultConfig();",
"initialConfig.resynthesis.correction.humanize = undefined;",
"initialConfig.resynthesis.correction.flexTune = undefined;",
"initialConfig.resynthesis.correction.vibratoPreserve = undefined;",
"initialConfig.resynthesis.harmony.voices = undefined;",
"const processor = new rootModule.Tunelet(48000, 128, initialConfig);",
"try {",
" assert.equal(processor.config().resynthesis.correction.humanize, 0);",
" assert.equal(processor.config().resynthesis.correction.flexTune, 0);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 0);",
" assert.equal(processor.config().resynthesis.harmony.voices, 4);",
" assert.equal(typeof processor.controlActivity().choirVoices, \"boolean\");",
" const initialTelemetry = processor.telemetry();",
Expand All @@ -330,18 +332,24 @@ function verifyRuntimeImport(consumerDir, packageName) {
" assert.equal(initialTelemetry.targetMidiNote, undefined);",
"",
" const twoVoiceConfig = processor.config();",
" twoVoiceConfig.resynthesis.correction.vibratoPreserve = 0.5;",
" twoVoiceConfig.resynthesis.harmony.voices = 2;",
" processor.setConfig(twoVoiceConfig);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 0.5);",
" assert.equal(processor.config().resynthesis.harmony.voices, 2);",
"",
" const undefinedVoiceConfig = processor.config();",
" undefinedVoiceConfig.resynthesis.correction.vibratoPreserve = undefined;",
" undefinedVoiceConfig.resynthesis.harmony.voices = undefined;",
" processor.setConfig(undefinedVoiceConfig);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 0);",
" assert.equal(processor.config().resynthesis.harmony.voices, 4);",
"",
" const oneVoiceConfig = processor.config();",
" oneVoiceConfig.resynthesis.correction.vibratoPreserve = 1;",
" oneVoiceConfig.resynthesis.harmony.voices = 1;",
" processor.setConfig(oneVoiceConfig);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 1);",
" assert.equal(processor.config().resynthesis.harmony.voices, 1);",
"",
" const tunedCorrectionConfig = processor.config();",
Expand All @@ -354,20 +362,24 @@ function verifyRuntimeImport(consumerDir, packageName) {
" const omittedCorrectionConfig = processor.config();",
" delete omittedCorrectionConfig.resynthesis.correction.humanize;",
" delete omittedCorrectionConfig.resynthesis.correction.flexTune;",
" delete omittedCorrectionConfig.resynthesis.correction.vibratoPreserve;",
" processor.setConfig(omittedCorrectionConfig);",
" assert.equal(processor.config().resynthesis.correction.humanize, 0);",
" assert.equal(processor.config().resynthesis.correction.flexTune, 0);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 0);",
"",
" const mono = new Int16Array(128);",
" const eventResynthesis = processor.config().resynthesis;",
" eventResynthesis.correction.humanize = undefined;",
" eventResynthesis.correction.flexTune = undefined;",
" eventResynthesis.correction.vibratoPreserve = undefined;",
" eventResynthesis.harmony.voices = undefined;",
" processor.processMono(mono, [",
' { offset: 0, event: { type: "resynthesis", value: eventResynthesis } },',
" ]);",
" assert.equal(processor.config().resynthesis.correction.humanize, 0);",
" assert.equal(processor.config().resynthesis.correction.flexTune, 0);",
" assert.equal(processor.config().resynthesis.correction.vibratoPreserve, 0);",
" assert.equal(processor.config().resynthesis.harmony.voices, 4);",
"",
" const input = new Int16Array(128);",
Expand Down Expand Up @@ -778,6 +790,7 @@ function verifyTypeDeclarations(consumerDir, packageName) {
" ...baseConfig.resynthesis.correction,",
" humanize: optionalVoices,",
" flexTune: optionalVoices,",
" vibratoPreserve: optionalVoices,",
" },",
" harmony: {",
" ...baseConfig.resynthesis.harmony,",
Expand Down
Loading
Loading