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

discretise does not work for multiple-cycle "holds" #547

Closed
kindohm opened this issue Aug 20, 2019 · 3 comments
Closed

discretise does not work for multiple-cycle "holds" #547

kindohm opened this issue Aug 20, 2019 · 3 comments

Comments

@kindohm
Copy link

kindohm commented Aug 20, 2019

This bug is occurring after pulling the latest from master after the #546 fix.

When using discretise it does not seem to "hold" values if the duration is given as greater than a single cycle.

I would expect this to "hold" a random speed value for eight cycles:

d1 $ s "bd*16" # speed (discretise (1/8) $ range 0.5 2 $ rand)

But instead it changes the value every cycle.

These also do not hold for 2, 4, or 16 cycles, respectively:

d1 $ s "bd*16" # speed (discretise (1/2) $ range 0.5 2 $ rand)
d1 $ s "bd*16" # speed (discretise (1/4) $ range 0.5 2 $ rand)
d1 $ s "bd*16" # speed (discretise (1/16) $ range 0.5 2 $ rand)

However, the patterns below do sound correct, holding for one half or one quarter cycles, respectively:

d1 $ s "bd*16" # speed (discretise 2 $ range 0.5 2 $ rand)
d1 $ s "bd*16" # speed (discretise 4 $ range 0.5 2 $ rand)
@yaxu
Copy link
Member

yaxu commented Aug 20, 2019

Thanks for this, unfortunately I missed it until after release.. It seems to work with _range rather than range:

d1 $ s "arpy*16" # speed (segment (1/8) $ _range 0.5 2 $ rand + 1)  

@yaxu
Copy link
Member

yaxu commented Aug 20, 2019

Yes the way range was patterning parameters was the culprit. Will need to look closely at how patterned parameters are implemented on other functions, too.
1f3cced

@yaxu yaxu closed this as completed Aug 20, 2019
@kindohm
Copy link
Author

kindohm commented Aug 20, 2019

Working great, thanks!

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

No branches or pull requests

2 participants