Thanks to the post by Fabricio Chamon on Youtube explaining how the ChOPS oscillator chop can be use to generate all the notes on a piano. He explained the base frequency formula
261.63 * pow(2,(0/12))
which produces the note C.
I used this basic concept to generate synthetic audio with CHOPS.
On the SOP side a attributewrangle vex code block below created a animated attribute which controlled the audio amplitude via a geometry Chop node and the rectangle rotation in this movie
this is the code ... it makes a flattened sin wave
float sinflatten(int currentframe; int cyclelength; float flattenamount){
// currentframe is an integer
// cyclelength is the number of frames in the wave cycle
// flattenamount range is float 0 to 10
float bsquared = flattenamount * flattenamount;
float sinval = sin(2 * $PI * ((float)currentframe/(float)cyclelength));
float sinvalsquared = sinval * sinval;
float sqrtval = sqrt( (1.0 + bsquared) / (1.0 + bsquared * sinvalsquared) );
float yval = sqrtval * sinval;
return yval;
}
float flattenamount = ch("flattenamount");
float amplitude = ch("amplitude");
float valoffset = ch("valoffset");
int cyclelength = chi("cyclelength");
float cycleoffset = ch("cycleoffset");
@newyval = amplitude * (valoffset + sinflatten($FF+cycleoffset, cyclelength, flattenamount));
@P.y = @newyval;