Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic/fix pdef clear using Psync #4792

Merged

Conversation

telephon
Copy link
Member

@telephon telephon commented Mar 1, 2020

Purpose and Motivation

Discussion see #4779

Types of changes

  • Bug fix
  • New feature
  • Breaking change

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

telephon added 5 commits March 1, 2020 17:44
Where the old source pattern is shorter than the quant value, Pdef /
EventPatternProxy would start the new pattern too early. As Psync
both cuts and extends, we can use this feature here.
@telephon telephon mentioned this pull request Mar 1, 2020
3 tasks
@telephon telephon changed the title Topic/fix pdef clear using psync Topic/fix pdef clear using Psync Mar 1, 2020
@telephon telephon requested a review from jamshark70 March 1, 2020 19:39
@totalgee
Copy link
Contributor

totalgee commented Mar 2, 2020

This solution (as well as #4779) works for the issues I reported in #4767.

@jamshark70
Copy link
Contributor

Was the Psync problem that a zero-duration pattern would roundUp to 0? I'd like to understand it before reviewing.

@telephon
Copy link
Member Author

telephon commented Mar 2, 2020

Was the Psync problem that a zero-duration pattern would roundUp to 0?

yes.

In EventPatternProxy we use Psync to wrap the old stream and we append the new stream to it so the switch happens at the correct moment. In the case considered, the old stream has already ended, so that Psync's internal elapsed count is still zero when we return the silence to fill the gap. That zero is rounded up to zero, so the switch happens immediately.

My strategy was to acknowledge that in such cases we implicitly assume a mindur, so I added that to Psync.

Copy link
Contributor

@jamshark70 jamshark70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor points only, thanks.

var <>quant, <>maxdur, <>tolerance;
*new { arg pattern, quant, maxdur, tolerance = 0.001;
^super.new(pattern).quant_(quant).maxdur_(maxdur).tolerance_(tolerance)
var <>quant, <>maxdur, <>tolerance, <>mindur;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see the reason for mindur.

My only suggestion here is to document the new argument.

The ordering is unfortunate but alternatives are worse.

Copy link
Contributor

@jamshark70 jamshark70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a minor point of formatting.

}
storeArgs { ^[pattern,quant,maxdur,tolerance] }
storeArgs { ^[pattern,quant,maxdur,tolerance,mindur] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add spaces after commas (since this is already touching that line).

Sorry, I had tried to include this in the other review but it got lost.

Copy link
Contributor

@jamshark70 jamshark70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@telephon
Copy link
Member Author

telephon commented Mar 3, 2020

Should this go into 3.11 ?

@totalgee
Copy link
Contributor

totalgee commented Mar 3, 2020

Should this go into 3.11 ?

That would be great, if it can! Thanks again for this.

@mossheim
Copy link
Contributor

mossheim commented Mar 5, 2020

Should this go into 3.11 ?

Based on the track record of the patterns library i think we should wait until after 3.11.0 is released to move this change into the 3.11 branch. then it can go through a beta cycle.

@mossheim
Copy link
Contributor

mossheim commented Mar 5, 2020

but as release manager it's ultimately @joshpar 's decision

@mossheim mossheim added the comp: class library SC class library label Mar 5, 2020
@mossheim
Copy link
Contributor

mossheim commented Mar 5, 2020

@telephon quick reminder to add labels to your PRs!

@mossheim mossheim merged commit 032f504 into supercollider:develop Mar 5, 2020
@joshpar
Copy link
Member

joshpar commented Mar 5, 2020

I think 3.11.1 is best. 3.11 RC is about hours away. I think a 3.11.1 release in the very near future is part of the plan in my mind.

@telephon telephon deleted the topic/fix-pdef-clear-using-Psync branch March 5, 2020 06:28
@mossheim mossheim mentioned this pull request Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: class library SC class library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants