Incrementing index at specific sample in buffer

Hi there,

Just wondering if anybody would know if there is a away to increment an index at a specific sample in the buffer? I am currently incrementing an index, read by the UI, to move a graphic. This is done via the ‘ProcessBlock’ call, using the buffer size to add to a running sample count, the index is incremented if the running count is greater than a set size:

void processBlock()
runningSamples =+ buffer.size();
if (runningSamples > intervalSize)


This has been working okay, however with larger buffer sizes it is not providing a very responsive graphical feedback to the audio.

Would anybody know if there is a way to be more exact than just counting the buffer the size? i.e. retrieving a current sample from the DAW?

Any help with this would be greatly appreciated!