3D audio visualization with opengl

For this project I made an audio visualizer that manipulates 3D models. In this case, when the signal goes above a certain threshold, the model is stretched in a new random direction. Additionally, using an fft, the signal produces a color based on the loudest detected amplitude, with red being mapped to low frequencies, blue to mid and green to high. Here is the max patch that accomplishes this:

But in addition to max I needed to write an opengl shader to manipulate the model. I also decided to handle lighting and color in a shader as well. Here is that shader: