Hi Charlie,

Maybe you want to have a look at the "Feedback" patch. Once placed within your 
macro (not "patch" - the term "custom patch" is used for patch extensions you 
programmed in another language) and run the composition, the feedback patch 
shows your "X" and "Y" output parameter twice: on the left side you can enter 
some "default" values, on the right side you get the values from the last 
iteration. Now you will need some "state" of your composition, so that the 
macro knows which x and y it should use.

I think that you should implement this complex state machine in a Java Script 
patch rather than in pure QC, because you will have a better understanding 
whats going on. Such constructions with feedback loops and recursive 
connections in pure QC can behave in a totally different way than you expect 
because you can't rely on a certain order of computation.

Achim Breidenbach
Boinx Software

On 15.09.2010, at 18:01, Charlie Francis wrote:

> This has had me confused for quite a long time. I have built a patch that 
> initiates an iterator on command using a stop watch and an external timebase 
> for use with animations.
> 
> My requirements for this patch is that it will iterate from one number to 
> another. Once the iteration has stopped, it should update the starting value 
> with the final end value. This way when the external timebase is reset back 
> to 0, the outputted value should still be the same as the end value, meaning 
> that if I connect this to a sprites x position, it will continue to stay in 
> the same position.
> I can then update the end value with a new number and begin the iteration 
> again, using the external timebase (stop watch), to animate the sprite to a 
> new position.
> 
> Now I have all of this working correctly (demo composition attached), just 
> enter in the coords you want the sprite to move to, and then click 'Start / 
> Stop', once the animation has stopped, click 'Start / Stop' again and type in 
> some new coords.
> 
> I have a few problems with this. If the animation is stopped mid way through, 
> the sprite returns to it's starting position. I tried feeding the end value 
> straight into the start value, but that changes the interpolation curve.
> The other problem is that I can't set a default start position, The sprite 
> will always start at 0,0. I have been thinking how I can change this for a 
> while but not come up with a solution. My only other programs experience is 
> with languages like PHP, so this style of programming is very different to 
> what I'm used to.
> 
> So my main question is! .....
> 
> Is there a way to have 2 inputs into a patch, so that you can set a default 
> value, and then update it from another place within the composition? Kind of 
> like how you store and update variables in PHP.
> 
> Thanks,
> Charlie
> <animator.qtz> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartzcomposer-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to