Task: Create VoiceSynthesizer Temporal Scenario Visual Laboratory

Create VoiceSynthesizer Temporal Scenario Visual Laboratory

An interactive multitrack editor for manual experimentation with synthesizer parameters over time, cyclic listening, and discovering interesting sounds.

Goal

Create a new visual interface not for cosmetic editing of an existing VoiceScenario, but as an experimental speech synthesis laboratory.

The main objective of the interface is to allow manual exploration of:

  • which synthesizer parameters;
  • in what sequence;
  • at what moments in time;
  • with what values and laws of change

produce a particular audible result.

We do NOT assume in advance that we know the correct scenario for a specific sound. The interface is specifically designed for exploration: the user moves time points and parameters, listens to the result, and can then save the discovered interesting sounds and export them along with logs/scenarios for subsequent analysis.


General Interface Model

The interface should be organized as a multitrack timeline, logically similar at the same time to:

  • automation lanes in a DAW;
  • a keyframe editor;
  • a Gantt chart, but only in terms of a shared timeline and event synchronization.

This is NOT a classic Gantt chart nor a list of set/animate commands.

Coordinates

For each track:

  • horizontal axis = time;
  • vertical axis = parameter value;
  • a parameter is defined by a set of editable points (time, value);
  • a point can be dragged horizontally to change the moment of the event;
  • a point can be dragged vertically to change the value;
  • the transition law between points is defined.

The UI may normalize the vertical scale to 0..1, but the physical parameter value must retain its own range and units (Hz, gain, etc.).


Separate Overall Sound Duration

An independent overall scenario duration parameter is required.

This is crucial: control parameters can be set or changed only at the beginning, but the resulting state must continue to sound for a long time.

Examples of the semantic model:

  • quickly set a state and hold a long AAAAA;
  • early events form MA, and then the state holds AAAAAAA for a long time;
  • after the last keyframe point, the value of each control continues to be held until the total duration of the scenario.

The duration should not be automatically truncated at the last control point.


Cyclic Playback

A "Loop" toggle must be provided.

In loop mode:

  • the scenario plays again immediately after finishing;
  • the user does not need to press Play every time;
  • parameter/point changes must take effect in the next playback cycle;
  • the user can move a point or value and hear several variant results over several consecutive repetitions.

This is a key mode specifically for manual sound discovery.


Parameter Tracks

At the first stage, the editor should work with all existing VoiceControlState parameters.

For each track, you need to see:

  • control name;
  • its physical value;
  • normalized position on the vertical scale;
  • keyframe points;
  • value holding between events;
  • transition shape between points.

The editor should show the actual temporal trajectory of the parameter, not just active animate segments.


Types of Transitions and Modulators

The architecture should be designed from the start so that more than just a single animate type exists between points.

An extensible model of a time interval converter/modulator is needed.

At a minimum, provide the ability to have different types in the future:

  • hold / constant value;
  • linear transition;
  • bezier transition;
  • periodic modulator;
  • sinusoidal modulation by formula;
  • impulse / burst;
  • repeating beat;
  • noise or other stochastic modulation;
  • other time functions.

That is, in the future, not only a keyframe should be placed on the timeline, but also a converter that forms a complex parameter trajectory over a given interval.

Example meaning: a parameter can have a stable base, but on top of it, periodic modulation works over a time interval.


Connection to Speech Physiology

The editor architecture cannot be designed as if each control is completely physically independent.

A human has a single speech apparatus:

  • one tongue;
  • one lip configuration;
  • one mouth/oral cavity;
  • one vocal tract;
  • one vocal cord and airflow system.

You cannot simultaneously set mutually exclusive articulatory states as if two independent languages or two independent mouth shapes exist.

While the current DSP operates in the acoustic space (f0, periodicity, noise, resonances, gains, etc.), the editor must be designed so that in the future it is possible to introduce coupled physiological/articulatory converters that control multiple DSP controls coherently.

Examples of semantic converters that may appear later:

  • mouth opening/closing;
  • change in tongue position;
  • pressure accumulation and release;
  • short plosive burst;
  • steady airflow;
  • articulator tremor/beat for R;
  • transition between articulatory states.

Important: this is not a requirement to immediately implement a full physiological model. The requirement is not to block such a possibility with the architecture.


Special Meaning of Temporal Structure

The editor must proceed from the premise that sound only makes sense in time.

For example, a plosive consonant is not a single parameter value, but a sequence of phases:

  • preparation/closure;
  • accumulation;
  • release;
  • burst;
  • noise or vocal tail;
  • transition to the next sound.

And a sustained sound can be the result of a stable state that is held for a long time after a short input transition.

Therefore, the user must see and edit the composition of phases over time, rather than just a list of numbers.


What to Save

A discovered experiment must be reproducible.

You need to be able to save:

  • total duration;
  • all tracks and keyframes;
  • transition/converter types;
  • their parameters;
  • the final VoiceScenario or compilable representation;
  • experiment metadata if necessary.

The existing VoiceScenario can be used as a runtime/execution format, but the UI should not be limited by its current command-centric form. A separate experimental/keyframe format that compiles into a runtime representation is acceptable.


Connection to Existing Runtime

The editor must use the same shared VoiceScenario runtime used by the synthesizer and visualizer, after appropriate refactoring.

You cannot have separate parameter execution semantics only inside the UI.

The actual sound and actually displayed trajectories must come from a single state machine.


What is NOT the Goal of the First Stage

Currently, it is not required to:

  • automatically guess the correct sound;
  • automatically construct a phoneme;
  • add new acoustic metrics just for visualization;
  • immediately build a full physiological model of the speech apparatus;
  • replace the decoder.

The primary applied goal is to maximize the simplification of manual experimentation:

  1. quickly place time points;
  2. change values;
  3. hear the result in a loop;
  4. understand the sequence of one's own actions;
  5. save successful options;
  6. export the found scenario and its logs for further analysis.

Result Criterion

The user can open the laboratory, set the total duration, enable Loop, place and move keyframe points of several parameters along a shared timeline, and continuously hear how changes affect the sound.

The interface should help specifically in searching for pre-unknown sounds, rather than requiring prior understanding of what JSON needs to be written.

Ворклоги

Detailed Progress on the Temporal Scenario Visual Laboratory

What Has Been Implemented

A separate, new experimental synthesizer and visual editor has been created, intentionally disconnected from the former VoiceSynthesizer and its accumulated complex DSP model.

This important architectural decision was made deliberately: the goal of the current stage is not to maintain compatibility with old scenarios or reproduce past experiments, but to obtain the cleanest possible laboratory bench for manual sound exploration.

The current structure includes:

  • a multi-track editor for temporal parameters;
  • keyframe points on a common timeline;
  • drag-and-drop by time and by value;
  • Play / Pause / Stop;
  • Loop mode;
  • independent total scenario duration;
  • timeline scrubbing (seek);
  • display of current parameter values;
  • transition types hold, linear, bezier, sine, burst, noise;
  • a separate new audio synthesis based on the Web Audio API;
  • a minimal acoustic model based on sawtooth + noise + formant filters + gain.

The UI now presents the main experimental tracks:

  • F0 / Pitch;
  • Periodicity;
  • Noise;
  • Formant 1;
  • Formant 2;
  • Formant 3;
  • Gain.

Visually, the interface turned out well as a laboratory tool: the timeline is readable, events are visible, parameters can be quickly changed, and the total duration is not tied to the last point. This allows for building long sustained sounds and state sequences.

Important Clarification of Objectives

The new editor should NOT currently serve as an interface to the old DSP.

It is conceived as an independent clean experiment:

simple sources + simple filters + temporal trajectories -> audible result.

The main research question:

Is it possible at all, manually through controlled trial and listening, to find at least some recognizable speech-like sounds?

That is, the current task is not the reproducibility of old VoiceScenarios, but finding the most minimal working acoustic model.

Why a Separate New Synthesizer Was Chosen

The previous synthesis branch accumulated many interdependent experiments and parameters. It is now difficult to understand where exactly the error lies, and changing one mechanism can easily break another.

Therefore, a clean bench is needed as a controlled environment where each new mechanism is added consciously and its effect can be heard in isolation.

The principle of further work:

minimal engine -> manual search -> observation -> discovery of missing mechanism -> add only that mechanism -> repeat experiment.

What the First Practical Check Showed

According to the developer agent, the set of features looks complete, but an actual verification of the result showed that the report was overly optimistic.

At the current stage:

  • most of the prepared sounds/presets are practically inaudible or do not yield the expected result;
  • the agent's report in itself cannot be considered proof of functionality;
  • among simple recognizable effects, only a hissing sound close to S is actually audible so far;
  • full-fledged A, M, R, T and other sounds have not yet been obtained manually or confirmed by ear.

This is not considered a failure of the experiment. On the contrary, the bench now makes it possible to figure out which exact mechanisms are minimally necessary for the emergence of specific sound classes.

Current Practical Value of the Laboratory

The practical value of the editor has not yet been definitively proven.

A more basic thing is currently being tested:

  1. Is there an audible causal link between a specific parameter and the result.
  2. Is it possible, by moving one or more points manually, to obtain a predictably changing sound.
  3. Is it possible to find stable acoustic classes:
    • vowel-like;
    • noise/fricative;
    • plosive;
    • nasal;
    • periodic/trembling;
    • other speech-like classes.
  4. Is it possible to save the found configuration as a reproducible recipe.

If these points are confirmed, the laboratory is already useful as a research tool, even if the sound quality is still far from human speech.

Important Conceptual Conclusion

There is no need to build a complex physiological speech model in advance.

It is more correct to first search for minimal acoustic mechanisms manually.

For example:

  • if R is impossible to obtain without a periodic modulator, this will become the experimental basis to add such a mechanism;
  • if T requires a sequence of silence -> burst -> noise tail, this should also stem from manual experiment;
  • if a certain vowel type requires a stable F0 + F1/F2/F3, this must be found and confirmed by ear.

That is, new features are added not by assumption, but by the observed deficit of the current model.

Current Limitations and Questions

  1. Each existing control needs to be tested individually and in minimal combinations.
  2. It is necessary to understand which of the current transition types are actually useful and which are still decorative.
  3. burst, sine, repeating oscillations, and noise modulations conceptually may turn out to be not just interpolations, but a separate class of temporal modulators. Perhaps later it is worth separating:
    • envelope / keyframes;
    • modulators on top of the base trajectory.
  4. It is necessary to check how correctly the physical ranges of parameters and their zero states are organized.
  5. Convenient saving of successful sounds and scenarios needs to be added when truly interesting results appear.
  6. Spectrograms and other methods of result analysis may be needed later, but the priority now is auditory manual search and causal clarity of the interface.

Criteria for Immediate Success

Not "the synthesizer already knows how to talk" and not "presets match letters."

The immediate success criterion is much simpler:

The user can turn on Loop, move a keyframe point or parameter, hear several options in a row, and consistently find at least some recognizable speech-like sounds, understanding what change led to them.

After finding interesting sounds, the scenario and logic will be used for subsequent analysis and for making decisions about which new mechanisms are truly worth adding.

Brief progress: the current implementation needs to be rewritten from scratch

Actual testing showed that the current component cannot be considered a viable foundation for further sound experiments.

Main issues:

  • The audio architecture is fundamentally unsuitable for high-quality synthesis. Parameters are updated in chunks via Web Audio nodes during playback, whereas for controlled experimental synthesis, it is more logical to pre-calculate PCM/an array of sample values based on the entire timing logic and pass the ready buffer to the AudioContext for playback.
  • The current DSP itself is poorly structured: a sawtooth passes through three serially connected narrow bandpass-formant filters, which almost destroys the periodic part; meanwhile, the noise goes through a separate direct path.
  • The UI timeline and audio timeline effectively have different clocks. Loop, seek, pause/play, and real audio time do not form a single state machine.
  • Sound control via requestAnimationFrame (~60 Hz) is unsuitable for short acoustic events, bursts, and fast transitions; additional smoothing blurs the events even further.
  • The lifecycle of audio sources contains race conditions and inconsistent states: repeated Play works unreliably, Stop can lead to unexpected sound resumption, and old callbacks/source refs can outlive state changes.
  • There are far too many independent refs/states/hooks in the UI/UX responsible for parts of a single playback state. Instead, a single useReducer / finite state machine with explicit stopped/playing/paused states and deterministic transitions is needed.
  • The implementation report turned out to be significantly more optimistic than the actual behavior: the interface visually looks like a finished laboratory, but basic user scenarios like Play/Stop/Replay and the sound results themselves are unreliable.

Conclusion: piecemeal fixing of the current implementation is impractical. The component needs to be rewritten from scratch, keeping only the general idea of a visual laboratory: timeline, parameter tracks, keyframes, loop, and manual sound discovery. The new version should be built around a single state machine and the pre-calculation of the audio buffer from the scenario.