Ppq / Beats / Bars -aware sample loop player.
Posted: Wed May 22, 2019 12:38 am
I am working on a sample loop player ,so far I have managed to have it sync to tempo regardless of original tempo.
I am wondering if it would be possible to - say I start 2 beats into a bar in the DAW that the loop would be aware of that and start playing two beats in ?
I might also start playing at a random spot in the bar and would like it to either sync up at the next beat or preferably start playing at the right spot no matter where in the bar i push play.
Now the loop is currently played with a 64 bit precision counter and I wonder how I could approach this .
The loop length in samples and DAW bpm is known so I am thinking If I could somehow Offset the precision counters start point ..I do have a start point input the the counter , but unsure how to get the PPQ position and translate that into the initial start position offset .
Or Maybe I am thinking this all wrong and there is a way to have sample accurate ramp to control this somehow ?
I do have a synced Ramp that would work but unsure how to translate that value to play the index for the wave reader. If i could somehow translate that 0-1 ramp to play the 4 bar 176400 sample (in this particular case) then I guess that would work.
Am I making sense ?
I am wondering if it would be possible to - say I start 2 beats into a bar in the DAW that the loop would be aware of that and start playing two beats in ?
I might also start playing at a random spot in the bar and would like it to either sync up at the next beat or preferably start playing at the right spot no matter where in the bar i push play.
Now the loop is currently played with a 64 bit precision counter and I wonder how I could approach this .
The loop length in samples and DAW bpm is known so I am thinking If I could somehow Offset the precision counters start point ..I do have a start point input the the counter , but unsure how to get the PPQ position and translate that into the initial start position offset .
Or Maybe I am thinking this all wrong and there is a way to have sample accurate ramp to control this somehow ?
I do have a synced Ramp that would work but unsure how to translate that value to play the index for the wave reader. If i could somehow translate that 0-1 ramp to play the 4 bar 176400 sample (in this particular case) then I guess that would work.
Am I making sense ?