I want to create a sine tone generator with the Accelerate framework. I'd like my generator to have an attack/release setting (i.e., an amplitude envelope).
I understand how to create a vector full of sine values. What I don't know is how to apply an amplitude envelope to my vector data.
I know I could create a ramped vector using vDSP_vgen to create a linear volume envelope vector and multiply my sine vector by my envelope vector. This seems wasteful, though, because I'm dealing with many data points and creating an intermediate vector just to store the amplitude envelope is quite wasteful of memory in my environment.
What's the best way to work with an amplitude envelope with the Accelerate framework?