Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39520 > unrolled thread

setTimout iteration causing lag

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2021-02-26 10:57 -0800
Last post2021-02-26 17:08 -0800
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  setTimout iteration causing lag Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-26 10:57 -0800
    Re: setTimout iteration causing lag "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-02-26 15:40 -0800
      Re: setTimout iteration causing lag Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-26 17:08 -0800

#39520 — setTimout iteration causing lag

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2021-02-26 10:57 -0800
SubjectsetTimout iteration causing lag
Message-ID<d3dcfe12-67f1-406a-836c-aa85db5ec0den@googlegroups.com>
My midiplayup solution in sequenser that use setTimeout is causing lag, should i try to come up with some statistical algorithm to resolve it or should i use buffered playup and will that playup work with simultaneous recording and keyboard playback?

Which route should i take change the playup or doing some statistical adjustment?

I really can't find any examples of buffered playup so i really do not quite understand how it work, i guess there is a buffer with intervals in PPQ where most is empty and it somehow send messages on some of them?

If so what is the PPQ "resolution" that generally fit the buffered approach?

Statistics or buffers, need some advice here?

[toc] | [next] | [standalone]


#39523

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2021-02-26 15:40 -0800
Message-ID<55d9ca3f-7e9b-4528-bcbb-2e63a01e80a0n@googlegroups.com>
In reply to#39520
On Friday, February 26, 2021 at 12:57:32 PM UTC-6, jonas.t...@gmail.com wrote:
> My midiplayup solution in sequenser that use setTimeout is causing lag, should i try to come up with some statistical algorithm to resolve it or should i use buffered playup and will that playup work with simultaneous recording and keyboard playback? 
> 
> Which route should i take change the playup or doing some statistical adjustment? 
> 
> I really can't find any examples of buffered playup so i really do not quite understand how it work, i guess there is a buffer with intervals in PPQ where most is empty and it somehow send messages on some of them? 
> 
> If so what is the PPQ "resolution" that generally fit the buffered approach? 
> 
> Statistics or buffers, need some advice here?

I suspect setTimeout is not causing any lag unless you are trying to use a value less than 10:

<https://groups.google.com/g/comp.lang.javascript/c/UQqCBUwOPw8/m/C2mBIMcuAwAJ>

[toc] | [prev] | [next] | [standalone]


#39524

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2021-02-26 17:08 -0800
Message-ID<acd9f819-f1e0-4ae5-87a8-e4627ccc0959n@googlegroups.com>
In reply to#39523
lördag 27 februari 2021 kl. 00:40:41 UTC+1 skrev Michael Haufe (TNO):
> On Friday, February 26, 2021 at 12:57:32 PM UTC-6, jonas.t...@gmail.com wrote: 
> > My midiplayup solution in sequenser that use setTimeout is causing lag, should i try to come up with some statistical algorithm to resolve it or should i use buffered playup and will that playup work with simultaneous recording and keyboard playback? 
> > 
> > Which route should i take change the playup or doing some statistical adjustment? 
> > 
> > I really can't find any examples of buffered playup so i really do not quite understand how it work, i guess there is a buffer with intervals in PPQ where most is empty and it somehow send messages on some of them? 
> > 
> > If so what is the PPQ "resolution" that generally fit the buffered approach? 
> > 
> > Statistics or buffers, need some advice here?
> I suspect setTimeout is not causing any lag unless you are trying to use a value less than 10: 
> 
> <https://groups.google.com/g/comp.lang.javascript/c/UQqCBUwOPw8/m/C2mBIMcuAwAJ>

No i am pretty sure it is not related to any screen draw "and i think draw use different timespann then note rendering i am pretty sure draw use interval in 1/24 th of second see setting. And the timeout is a different process, but anyhow you can use checkboxes to turn of  any rendering it will still lag.
Piano Notes Canvas
Draw key press
Scroll time/bar
But then again i can be wrong and missed something.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web