Audio engine and DSP library for Android, written in C++ providing low latency performance within a musical context, while providing a Java/Kotlin API. Supports both OpenSL and AAudio.
MIT License
264
stars
45
forks
source link
setTempo creates invalid boundaries if loop is not starting at buffer position 0 #51
if a loop is running from start > 0 to end > start (set by setLoopRange()) and setTempo() is called I observed:
1) buffer positions of audio events are scaled according to ratio (oldTempo/newTempo)
2) min_buffer_position stays untouched (but should be scaled too?)
3) max_buffer_position is samples_per_bar amount_of_bars bout should be min_buffer_position + samples_per_bar amount_of_bars
Maybe I'm not using it correctly. But changing handleTempoUpdate() to:
float ratio = tempo / aQueuedTempo;
....
min_buffer_position = min_buffer_position ratio;
max_buffer_position = ( min_buffer_position + samples_per_bar amount_of_bars ) - 1;
if a loop is running from start > 0 to end > start (set by setLoopRange()) and setTempo() is called I observed: 1) buffer positions of audio events are scaled according to ratio (oldTempo/newTempo) 2) min_buffer_position stays untouched (but should be scaled too?) 3) max_buffer_position is samples_per_bar amount_of_bars bout should be min_buffer_position + samples_per_bar amount_of_bars
Maybe I'm not using it correctly. But changing handleTempoUpdate() to: float ratio = tempo / aQueuedTempo; .... min_buffer_position = min_buffer_position ratio; max_buffer_position = ( min_buffer_position + samples_per_bar amount_of_bars ) - 1;
Helped me.