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

Classlib: Event: Fix strum, issue #4405 #4406

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

smrg-lm
Copy link
Contributor

@smrg-lm smrg-lm commented May 16, 2019

Purpose and Motivation

This patch Fixes #4405 issue with strum parameter for Event as described there.

Types of changes

  • Bug fix

To-do list

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

Copy link
Member

@telephon telephon left a comment

Choose a reason for hiding this comment

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

Looks very plausible!

@smrg-lm
Copy link
Contributor Author

smrg-lm commented May 17, 2019

for the sake of completeness, other way to implement it could be to extract the ids from bndl like bndl.flop[2].

Line 587 (without this patch), could be:

[15 /* \n_set */, bndl.flop[2], \gate, 0].flop,

bndl array is a larger data structure however I don't know if flop is faster than reverse for this case or how much that is important in this context.

This patch follows implementation semantics used before in that function and ids variable isn't used afterwards (same as bndl). I just thought that to follow current implementation was better in any case.

@smrg-lm
Copy link
Contributor Author

smrg-lm commented May 17, 2019

And, I just saw a possible source of confusion:

Before, line 554:

~id = ids = Array.fill(bndl.size, { server.nextNodeID });

should ~id be reassigned? I don't think so because ids are just synth instantiated in reverse temporal order, ~freq wouldn't change either for example.

The thing is that ids was not a constant in that block, and why is used as nil in line 537 is something I don't want to ask.

I'm just sharing my reasoning about this.

@telephon
Copy link
Member

bndl array is a larger data structure however I don't know if flop is faster than reverse for this case or how much that is important in this context.

reversing an array of a couple of numbers will certainly be faster than a flop of the whole structure. If in doubt, you can check, e.g.:

a = (0..32);
b = [2, a, 5];

bench { a.reverse };
bench { b.flop };

should ~id be reassigned?

No, as you say, the order of the variable ids is really only the order for the scheduling timing, not the order of addressing.

The thing is that ids was not a constant in that block, and why is used as nil in line 537 is something I don't want to ask.

I'll answer anyway. It in nil because we don't know how many synths (and therefore how many ids) we'll need before multichannel expansion in

bndl = flopTogether(
bndl,
[sustain, lag, offset]
);

@smrg-lm
Copy link
Contributor Author

smrg-lm commented May 22, 2019

Thanks for the review Julian. My first thought about the variable was it was not initialised, "that's wrong", then I thought it's there because clearly marks the place for the ids defined later as a name instead of raw nil. However, after that I decided for me it would have been better to use nil because the next operations in that array slot makes clear that there go ids. I was a little jocular.

@telephon
Copy link
Member

ah, yes! Thanks for the discussion.

@nhthn nhthn added the comp: class library SC class library label Jun 2, 2019
Copy link
Contributor

@nhthn nhthn left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

@mossheim mossheim merged commit a13b6e1 into supercollider:develop Jun 4, 2019
@patrickdupuis
Copy link
Contributor

Should this be merged into 3.10 as well?

nhthn pushed a commit that referenced this pull request Jun 9, 2019
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.

Event: negative strum Bug and Fix
5 participants