Timing Issue - playing_position is earlier than expected?

Learn about building and using Max for Live devices.
Post Reply
gavspav
Posts: 342
Joined: Tue Jul 12, 2005 12:43 am

Timing Issue - playing_position is earlier than expected?

Post by gavspav » Fri Dec 18, 2009 5:48 pm

I must be doing something wrong here - can anyone enlighten me?

I'm banging the get playing_position at the beginning of every bar to get the clip position.

I'm expecting a bit of latency because of the time it takes to get the info back from the api.

But I'm finding that the reported position is actually earlier than I would have expected eg after 1 bar the playing position is about 3.89.

This is particularly problematic for my intended purpose.

If anyone could have a look I'd be very grateful.

You might have to use the bang in the device gui to load the paths (OT loadbang seems unreliable?)

Here is the code.You need a clip which is warped from its start, straight at the project tempo.Experiment with a one bar loop.

Thanks.

Code: Select all

<pre><code>
----------begin_max5_patcher----------
912.3oc4Y10aaBCEF95jeEVncYVE17Qfc019aTUE4.tMdhXy.mtzU0+6yeDR
on.3DHrH0aHEiC7dd3bd8wouNelyZ9dRoC3af6Ayl857YyzCoFX1gym4rEuO
ICWpmly5cBAm4rvbI1tsTVFQnuF78A46DMG0Lj3kbh4w4rFydxA7vgKmiEIa
nrmVUPRDlY3uz6N2EfP0Aja0wieCZpVP70+5qv.G0XuMet5vhauPwCZhB+39
CFO2KIXXj+H+xUAifrW+jcd7jgG5vfOxYhR5e0gATIpyJpeLiiEuG1paFCuU
eUmeTPwYfexyRcZmJAdAJP36peO6gtKXA.FcZpf7FQpH.qAq67EuUjA0Y9vh
l4EW.fbWpHCbYb+.BFNh.JYiT4jgSHu1HjhNTln5iAvHOEPjUSHStjtNqMFE
Ml4PEXVYNuPL7Jr31nTMBsnpd6j+wol0X.UWeMNQK6hpH3kfUoNkTv5TLzYW
DdDDMbmKHkDl.KnbVsHFEpyefPn9CW8Yn3ZQ74Sw9um0ES8Hudcs+HlzJQRp
wbZnU1VtV3k34owjdIxfftx6fWTd2VRYI9cusinQJkM.wFZ4pTxyzDBHAy3L
ZBNaUNtfvDWwURGFuLsVDYVovTvF1BwbG4EQKsOQBcoKh1Eb5OOJ.oW5zqyN
tPiZhTAOmTHdAjmgeQoobdIUWfacBDZLSf5hQHc5Bx.InueWkawvwzHh9L4N
95RRwyjhgCFTW8YbgvILVaa6YbuWF2UFTznyFkczvKt5r+qAwFyVXL6PyXS2
FaV5Oo1zfjLZ9pxLtnD7En9rauBuC4VU6GLxqqBuP3U0dRgpUTVJYe0bynLR
BeGSTOE51Ad9wZpEqMsLIh9srfm2mKKq.WSml9A8aYE7IywxzNPbT+FVPzHh
lsDQAG3y.e+26vLgL70mfSDRlAfWQqo9ZDuqs+4dnwaSeAlJsVwk2GRkzSQa
gz32UT+bTi+QHVx2UjTo4p6mr++iOpTRofxNtEo6Otoy5SZCMMknudEk1RSy
4x8DePEfGN46TaEUiG2o0TzjJInMRR1w+jpIWKzjrc6oTSMdbsnooWRv9d0M
sXBZilB9vbt5XxhWbASJjBsolS1v6TpoXqrllV6xFH3lPSvPKRvC+Ono93T7
zpIaV8sgtu1RJxlTbj2jZNgrwcBNsVAdt1xoyPSA99p+uS9tHU+eC68nMqDO
wcrDbs6hRdxay+m86vzs
-----------end_max5_patcher-----------
</code></pre>

Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: Timing Issue - playing_position is earlier than expected?

Post by Tone Deft » Fri Dec 18, 2009 9:30 pm

I couldn't get that patch rolling. maybe you could zip up a Live project with the patch and sample in place. all I could see with a print was [transport] sending out the beat count correctly. the stuff on the right gets banged and sends out messages but I'm not seeing activity in the float box you have setup to read data.
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: Timing Issue - playing_position is earlier than expected?

Post by broc » Sat Dec 19, 2009 10:19 am

Somehow I was able to run the patch and got similar results: the observed value varies between 3.82 and 3.98. But I think the behavior is normal as the observer updates the value only at certain time intervals. So it shows some old/early value measured at the last interval. For more accurate timing you could try using the live.object instead and poll it with a fast metro.

gavspav
Posts: 342
Joined: Tue Jul 12, 2005 12:43 am

Re: Timing Issue - playing_position is earlier than expected?

Post by gavspav » Sat Dec 19, 2009 1:30 pm

Thanks to you both for having a look.

Broc - you are logically correct about the use of the observer but using live.object returns similar results. I've altered the patch (below) to bang the get property message to a live.object every time a new bar is reached.

Tone I've uploaded a small set http://dl.dropbox.com/u/3202702/timetest%20Project.zip which should demonstrate what I'm on about.

Should work off the bat but if it doesnt show you float values after a couple of loops, click on the big button!

gavspav
Posts: 342
Joined: Tue Jul 12, 2005 12:43 am

Re: Timing Issue - playing_position is earlier than expected?

Post by gavspav » Mon Dec 21, 2009 11:03 am

Hmm thinking of posting this in the bugs section if no-one can show me the error of my ways.

Surely this isnt cirrect behaviour?

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Re: Timing Issue - playing_position is earlier than expected?

Post by Surreal » Mon Dec 21, 2009 5:56 pm


gavspav
Posts: 342
Joined: Tue Jul 12, 2005 12:43 am

Re: Timing Issue - playing_position is earlier than expected?

Post by gavspav » Mon Dec 21, 2009 7:01 pm

Oh yeah never spotted that - thanks.

Post Reply