-
Notifications
You must be signed in to change notification settings - Fork 64
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
Multiple outputs from a single ControlGenerator (or Generator?) #184
Comments
Couldn't this be achieved with a simple getter method that returns a Sent from my iPhone On Jun 12, 2013, at 2:04 PM, Michael Dewberry [email protected] Use cases:
— |
Yep, I think if a generator is responsible for ticking/updating its sub-generator outputs, then you can just use a getter to pass it along to another input: // Trigger an envelope when another one finishes
// ADSR::finished() returns a ControlGenerator that is triggered when envelope is done
ADSR env1 = ADSR(0.001, 0.5, 0.0, 0.01).trigger(someTrigger);
ADSR env2 = ADSR(0.001, 0.5, 0.0, 0.01).trigger(env1.finished()); |
@Dewb for that envelope example if you're up for trying that out, go for it. I would say that the "finished()" output should be a |
Yeah, that would work, I'll give it a shot. Similarly, a Klee-style sequencer could have .pitchA(), .pitchB(), .gate1(), .gate2() control generator methods. |
Is this the strategy you mentioned in #178? Wasn't sure if you had something more elaborate in mind. |
Yeah, that's it. Re: the sequencer idea - I think in that case it might be worth it to make another base class for Tonic objects that manage a series of explicit generator outputs, but don't produce output themselves. Otherwise, there is no compile-time check to prevent someone from trying to use that object as a generator directly, which doesn't make sense. The sequencer could also be made more generic by initializing it with a desired number of steps, and getting each output by passing in the index, so gate(1) gate(2) rather than gate1(), gate2() |
@morganpackard I see you just added a finishedTrigger to BufferPlayer; looks like I could follow your example to add the same feature to ADSR, if you weren't already planning on doing that. |
Hold off on that. I have that in a commit that I'll be merging in to dev soon. |
Cool, I suspected as much. Thanks! |
Use cases:
The text was updated successfully, but these errors were encountered: