Sadler has an elegant and ingenious solution, as is so often the case.
As a personal challenge I had an attempt at an ISF module (
SineWaveDual.fs, attached) .
The default settings appear to be a single sinewave, but actually it's two summed together. Adjust
Sine 2 Freq &
Sine 2 phase to see.
I'm sure someone with better maths could add other functions, but I barely understood what was going on so my approach was somewhat empirical.
My changes were almost entirely confined to replacing "
Function(float x)"
I'd tried using the plotting routine in my previous link, but couldn't get it working (doubtless due to a combination of ignorance and carelessness).
As an alternative I searched Shadertoy for "plot" (
https://www.shadertoy.com/results?query=plot), and chose
https://www.shadertoy.com/view/3sKSWc as a basis for development. It would be safe to assume that Shadertoy's default non-commercial licence applies to my derived version.
Vidvox's excellent ISF editor
https://isf.vidvox.net/desktop-editor/ can import and convert many Shadertoy shaders , as can Magic's script
https://magicmusicvisuals.com/utils/sha ... to_isf.php
In this case I imported using Magic's script, then added the controls and re-wrote a function using the ISF editor (which has excellent syntax checking).
The Speed control on this module currently has no effect. The Line Width adjustment was simply a quick hack, I'm sure it can be done better.
FWIW this module feeds nicely into the
Circle Wrap Distortion ISF module.