Skip to content

Fix: Delay timings#4

Open
vHeemstra wants to merge 1 commit intomscuthbert:masterfrom
vHeemstra:patch-2
Open

Fix: Delay timings#4
vHeemstra wants to merge 1 commit intomscuthbert:masterfrom
vHeemstra:patch-2

Conversation

@vHeemstra
Copy link

  • Consistent setting of delay.
    • Less than ctx.currentTime: assume relative delay, so add ctx.currentTime for absolute timed instructions.
    • Else: assume absolute timing, so use as-is.
    • Note: When a stream buffer is used, the delay is set using a setTimeout() with delay as number of seconds. In case of absolute delay use, this would not be correct. So maybe never allow absolute delay timings?
  • Removed inconsistent returns.
  • Some additional cleanup/refactoring.

* Consistent setting of delay.
   - Less than `ctx.currentTime`: assume relative delay, so add `ctx.currentTime` for absolute timed instructions.
   - Else: assume absolute timing, so use as-is.
   - **_Note:_** When a stream buffer is used, the delay is set using a `setTimeout()` with `delay` as number of seconds. In case of absolute delay use, this would not be correct. So maybe never allow absolute delay timings?
* Removed inconsistent returns.
* Some additional cleanup/refactoring.
@mscuthbert
Copy link
Owner

Sorry @vHeemstra -- I missed this PR ! Will look at it soon -- please ping if I forget again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants