Quote:
Originally Posted by xackley
Is this a problem of not checking a beat_position != savedbeat_position when looping. Start position keeps shifting because the loop controls start and end?
|
With this little script, I check that the new beat_position is the correct one based on previous position + samplesblock.
The math must be ok. As long as I don't loop the values do match.
Now on a loop, I get some strange results:
my loop is between beat 4 and 8 ( 1 bar), tempo=30, buffer=4096 samples
next should be position : 8.021769 (0.021769 too long)
beat_position after the loop: 3.975329 (0.024671 too long)
Values are changing each time off course, but this means that the loop is not 4 beat long as it should be but a little longer.
So, I can compensate and send the clock at the correct time to keep the right tempo, but it will get out of sync.
A trick would be to compensate the tempo, but as we don't know in advance where the loop is, it's a bit hard to do it in a smooth way, not even speaking about my little brain :/
I'm not aware of all the issues, but wouldn't it be better that reaper splits the buffer in 2 on a loop ?
At least as an option (Accurate loop size) ?
The code I used for testing:
Code:
desc:test
slider1:0<0,0,0>Low buffer size
slider2:0<0,0,0>Hi Buffer size
slider3:0<0,0,0>init counter
slider4:0<0,0,0>Next_beat_position
slider5:0<0,0,0>beat_position
//-------------------------
@init
slider1 = 50000;
slider2 = 0;
slider3 = slider3+1;
Next_beat_position = -1;
//-------------------------
@slider
//-------------------------
@block
samplesblock < slider1 ? slider1 = samplesblock;
samplesblock > slider2 ? slider2 = samplesblock;
play_state&1 ?
(
beat_position != Next_beat_position ?
(
slider4 = Next_beat_position;
slider5 = beat_position;
);
Next_beat_position = beat_position + samplesblock*tempo/(srate*60);
);
Quote:
Originally Posted by xackley
Also the download version contains only 2 sliders.
|
It should have 6 sliders, v1.1