PRESSURE / TouchDesigner source / v01

Status
The shared shader body has been compiled and rendered on the RTX 5070 Ti in
OpenGL 3.3. The browser preview uses the same shader. TouchDesigner was not
found on this machine, so the builder and native wrapper remain untested.

Create the network
1. Open an empty TouchDesigner project and open the Python Textport.
2. Run the following command (update p if you moved the folder):

p = r'C:/Projects/pressure-v01/touchdesigner/build_pressure.py'; exec(compile(open(p, encoding='utf-8').read(), p, 'exec'), dict(globals(), __file__=p))

3. Enter the new pressure_v01 Base COMP. Look at OUT and shader_messages.
4. Select the Base COMP to adjust the controls on its Pressure page.
5. Once checked, right-click the Base COMP and save it as a TOX.

The builder chooses a new name if a Pressure component already exists.
It embeds the shader and does not delete nodes or save over your project.
The initial output is 1024 x 576. Raise the resolution as your license permits.

Manual setup if your TouchDesigner build uses different parameter names
Create a Text DAT containing pressure_pixel.glsl and a GLSL TOP referencing it
in Pixel Shader. Use GLSL 3.30, custom resolution, and these vector uniforms:

uTime     = time in seconds, output width, output height, demo toggle (0 or 1)
uMaterial = bend (1), ripples (1), roughness (0.20), warm light (0.35)
uInput    = bass (0), transient (0), seconds since manual strike (100), strength (0)
uView     = camera (0 angle / 1 front / 2 detail), 0, 0, 0

The shader already applies display tone mapping and gamma. Avoid applying a
second display transform; check the TOP color-space settings in your build.

Audio connection
Begin with an Audio File In CHOP so you can repeat the same passage.
Use an Audio Spectrum CHOP to separate a low band (about 35-180 Hz) and a high
band (about 1.8-9 kHz). Derive band levels, normalize and clamp to 0-1.
Smooth the low envelope; use a positive change in high-band level with a short
decay for transients. Export those values to Bass and Transient. Set Demo off.
Audio Device In CHOP can replace the file after the mapping is checked.
The builder does not yet construct or validate this audio network.

For a manual strike, set Strength to 1.8 and drive Strikeage from 0 upward in
seconds. A static Strikeage value holds the wave at that age.

References (Derivative documentation)
https://derivative.ca/UserGuide/Write_a_GLSL_TOP
https://derivative.ca/UserGuide/GLSL_TOP
https://derivative.ca/UserGuide/Sequence_Class
https://derivative.ca/UserGuide/Page_Class
