-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Can't use :beat-ratio as Dynamic parameter #16
Comments
That’s correct. The oscillators are low-level, and optimized to be very efficient. They don’t take variable parameters of any sort, and include only as much code in the functions they return as needed to implement the features they are configured for when you create them.
Oscillated parameters build on oscillators at a higher level of abstraction, and that is where show variables and dynamic values can be introduced, to configure things like the maximum and minimum values by transforming the output of the oscillator. So unfortunately there is currently no way to do what you are trying to do in the section that doesn’t work. I think it will be possible to add support for dynamic parameters to them, without losing the optimizations that are possible in the cases where you are passing in constant values. That is why I built some of the complexity into the dynamic parameter mechanism, so that code can look at the parameter and determine if its value is going to change between effect frames or not, and optimize based on that. I will mark this as an enhancement, and try to make it work the way you want when I have a chance. How urgent is it? If you want to learn a lot about how dynamic parameters work, you could take a crack at it yourself, otherwise I might have time tomorrow night. |
Although I just realized that this will not be as easy as I hoped. The current way oscillators are called does not give them enough information to evaluate dynamic parameters. I will have to study everywhere they are used and see if it will be possible to add those arguments before we can proceed. |
Another idea is to use spatial-param in oscillators creation like this:
I think it fails here: https://gist.github.com/dandaka/50081ee8f72ff7b9f9ea Maybe there is another way to achieve this effect? My goal is simple. I want to spread oscillators phase shift across fixtures on stage. I don't see in your examples anything like this, but I think it is a pretty basic and common effect. |
All right, the rewriting of oscillators to support dynamic parameters is well underway. It is a sweeping change, and I am taking time as well to fundamentally restructure the way they are written, to get rid of a whole bunch of duplicated code, because I didn’t want to have to change so many copies of it, and because I am a lot better at writing concise, smart Clojure than when I first started this project. So it will probably be another day or two, I don’t have much time for coding on Wednesdays. |
I seem to have them all working! I have merged the changes to master. I need to do a little more testing, and update the documentation, but if you are brave you could start trying it based on the API doc, which is updated. I put in deprecated stubs for backwards compatibility, but you will want to change your code to use the new functions, because the old ones will go away in 0.1.7. Now every parameter you use in making an oscillator can be dynamic. This was a lot more work than I expected, but I was able to make it a lot more powerful and flexible than I expected, and all without losing any efficiency for the simpler, non-dynamic cases. Woot! |
All right, I have updated the documentation to reflect the new, much better, design of oscillators. Thanks for prompting me to upgrade these to fit the flexibility that the rest of Afterglow has developed! |
This works fine:
This is not working:
https://gist.github.com/dandaka/b023cea7d4d4296e85d6
The text was updated successfully, but these errors were encountered: