![]() |
#1 |
Human being with feelings
Join Date: Aug 2022
Posts: 19
|
![]()
Tested with Reaper 6.80 on macOS Monterey and u-he plugins (you can test with the CLAP betas available on KVR: https://www.kvraudio.com/forum/viewtopic.php?t=588919).
It looks like Reaper is sending some wrong values when a CLAP plugin requests the current song position during playback. Using the AU version we are getting the expected numbers, e.g. 0.00, 4.00, 8.00. Using the CLAP version of our plugins, we always get 2.00, no matter at which position the host transport locator currently is. This prevents position based trigger resets in our CLAP plugins from functioning. Here's a short video, hopefully explaining the issue: https://we.tl/t-G0ddl3xTa8 |
![]() |
![]() |
![]() |
#2 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 16,954
|
![]()
I think REAPER always sends up-to-date clap_event_transport values with every clap_plugin:: process() call. As far as I can tell, clap_event_transport::song_pos_beats and clap_event_transport::song_pos_seconds are updated as the play position changes.
Is that what you are looking at for the song position? If so, which of those fields are you looking at, and would you mind being specific about how you are converting the value back to a timeline position (because the values are encoded as fixed point, as per clap/fixedpoint.h) ? For example if playback starts at t=0 with buffer size 1024 samples and 120bpm, on the first process() call REAPER sends song_pos_beats=song_pos_seconds=0. On the second process() call REAPER sends these values: song_pos_beats 91625969 song_pos_seconds 45812984 |
![]() |
![]() |
![]() |
#3 |
Human being with feelings
Join Date: Aug 2022
Posts: 19
|
![]()
I'll post what I got from Urs.
Using this code: // transport state and ppq clock if(transportEvent->flags & CLAP_TRANSPORT_HAS_BEATS_TIMELINE) { // AM_STD::log( "handleClapTimingEvent: double time: %.5f", clapBeatTimeToDouble( // transportEvent->song_pos_beats ) ); globals->setCurrentQuarter(clapBeatTimeToDouble(transportE vent->song_pos_beats), clapBeatTimeToDouble( transportEvent->bar_start ), transportEvent->flags & CLAP_TRANSPORT_IS_PLAYING); static int cnt = 0; if( --cnt < 0 ) { cnt = 100; AM_STD::log("song_pos_beats / 256: %d bar_start / 256: %d ", (int)( transportEvent->song_pos_beats >> 16 ), (int)( transportEvent->bar_start >> 16 ) ); } } We get the following from Reaper (this is the output from around 15 bars): song_pos_beats / 256: 32768 bar_start / 256: 32768 song_pos_beats / 256: 32768 bar_start / 256: 32768 song_pos_beats / 256: 32768 bar_start / 256: 32768 song_pos_beats / 256: 58994 bar_start / 256: 1048576 song_pos_beats / 256: 97418 bar_start / 256: 1048576 song_pos_beats / 256: 135842 bar_start / 256: 1048576 song_pos_beats / 256: 174266 bar_start / 256: 1048576 song_pos_beats / 256: 212690 bar_start / 256: 1048576 song_pos_beats / 256: 251114 bar_start / 256: 1048576 song_pos_beats / 256: 289538 bar_start / 256: 1048576 song_pos_beats / 256: 327962 bar_start / 256: 1048576 song_pos_beats / 256: 366386 bar_start / 256: 1048576 song_pos_beats / 256: 404810 bar_start / 256: 1048576 song_pos_beats / 256: 443234 bar_start / 256: 1048576 song_pos_beats / 256: 481658 bar_start / 256: 1048576 song_pos_beats / 256: 520082 bar_start / 256: 1048576 song_pos_beats / 256: 558506 bar_start / 256: 1048576 song_pos_beats / 256: 596930 bar_start / 256: 1048576 song_pos_beats / 256: 635354 bar_start / 256: 1048576 song_pos_beats / 256: 673778 bar_start / 256: 1048576 song_pos_beats / 256: 712202 bar_start / 256: 1048576 song_pos_beats / 256: 750626 bar_start / 256: 1048576 song_pos_beats / 256: 789050 bar_start / 256: 1048576 song_pos_beats / 256: 827474 bar_start / 256: 1048576 song_pos_beats / 256: 865898 bar_start / 256: 1048576 song_pos_beats / 256: 904322 bar_start / 256: 1048576 song_pos_beats / 256: 942746 bar_start / 256: 1048576 song_pos_beats / 256: 981170 bar_start / 256: 1048576 song_pos_beats / 256: 1019594 bar_start / 256: 1048576 song_pos_beats / 256: 1058018 bar_start / 256: 1048576 song_pos_beats / 256: 1096442 bar_start / 256: 1048576 song_pos_beats / 256: 1134866 bar_start / 256: 1048576 song_pos_beats / 256: 1173290 bar_start / 256: 1048576 song_pos_beats / 256: 1211714 bar_start / 256: 1048576 song_pos_beats / 256: 1250138 bar_start / 256: 1048576 song_pos_beats / 256: 1288562 bar_start / 256: 1048576 song_pos_beats / 256: 1326986 bar_start / 256: 1048576 song_pos_beats / 256: 1365410 bar_start / 256: 1048576 song_pos_beats / 256: 1403834 bar_start / 256: 1048576 song_pos_beats / 256: 1442258 bar_start / 256: 1048576 song_pos_beats / 256: 1480682 bar_start / 256: 1048576 song_pos_beats / 256: 1519106 bar_start / 256: 1048576 song_pos_beats / 256: 1557530 bar_start / 256: 1048576 song_pos_beats / 256: 1595954 bar_start / 256: 1048576 song_pos_beats / 256: 1634378 bar_start / 256: 1048576 song_pos_beats / 256: 1672802 bar_start / 256: 1048576 song_pos_beats / 256: 1711226 bar_start / 256: 1048576 song_pos_beats / 256: 1749650 bar_start / 256: 1048576 song_pos_beats / 256: 1788074 bar_start / 256: 1048576 song_pos_beats / 256: 1826498 bar_start / 256: 1048576 song_pos_beats / 256: 1864922 bar_start / 256: 1048576 |
![]() |
![]() |
![]() |
#4 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 16,954
|
![]()
Ah I see, that's our error. REAPER is putting the bar_start value in the loop_start_beats field. We'll fix this for the next build, thanks for the report.
|
![]() |
![]() |
![]() |
#5 |
Human being with feelings
Join Date: Aug 2022
Posts: 19
|
![]()
Awesome, thanks so much.
|
![]() |
![]() |
![]() |
Thread Tools | |
|
|