@whale-av thank you for the links. They also use a 2d texture for the audio information.
The problem is I am really a beginner with Open Frameworks, and I do not know how to create a texture from those 2 arrays.
But another solution could be just to pass the two arrays as arrays to the shader.
Here is an example for that method:
Theoretically this should work this way:
"Sometimes it is necessary to pass to the shader not just a single float value but an
array of floats. To do this, just declare the array in the shader's code as follows:
#define N (256)
uniform float myArray[N];
Now bind the array from the openFrameworks project' code:
shader.setUniform1fv( "myArray", myArray, 256 );
In the preceding line of code, myArray is a float array with 256 elements."
I can access the Pure Data arrays with the pdArray method.
But while it works to set single values for setUniform1f it seems not possible to set arrays for setUniform1fv.
I get this error message:
ofelia: [string "package.preload['1011-glslBlend2Images'] = ni..."]:68: Error in ofShader::setUniform1fv (arg 3), expected 'float const *' got 'table'
For this Line:
shader:setUniform1fv("array2", array2:get(0), 512);
While "array2" is one of the pdArrays.