I am new very to audio programming and am having trouble figuring out the right kind of algorithm for converting control events (e.g. like MIDI) to real-time sound genesis with a buffer.
At the moment I am currently trying to convert data which comes from a modulation wheel to alter the pitch of a sine wave. On one thread I am storing the events coming in in a ring buffer, with the value and timeStamp of when they occurred. On the audio thread, I need to build a buffer with the sinewave using the arbitrary value->frequency mapping.
How is this normally done for optimal performance, i.e. if the buffer is very low, do you just take the most recent value for the control, do you interpolate, or what algorithm do you do to get a value for the control at each sample?