Conditional Logic?

kennyhorn's picture

Hello,

I'm new to QC, trying to build a New Years Eve countdown clock, would appreciate any guidance, struggling a little with the QC logic...

The clock needs to countdown in mm:ss from 11pm, then just seconds in the final minute. At 00:00 I'd like to play a QT file.

I found this old forum archive... http://tinyurl.com/2vya4ed and have managed to get half way there, as attached.

Not quite sure how to trigger the QT patch at 00:00. I can't think how to stop the countdown part and play the QT, without the counter happening in the background? I was thinking I could use a condition something like if minutes = 0 AND seconds = 0 then play QT but this would return false when the counter restarts at 59:59.

Kenny.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

photonal's picture
Re: Conditional Logic?

I've added some logic tests which should now:

i) Enable the hh:mm:ss countdown from 2300 to 2359.

ii) Enable the ss countdown from 235900.

iii) Tigger action when it's midnight.

Watch out for your clock time; daylight saving hours etc!!

PreviewAttachmentSize
CountDownClock.qtz21.38 KB

kennyhorn's picture
Re: Conditional Logic?

Fantastic!! thanks for your help, that's far more than I expected! just figured out all the extra bits you added...

I was trying to find a patch that will fire off a "true" event at 00:00:00 which would allow me to start a QT mov playing (or another part of the composition with a "HAPPY NEW YEAR" message), but won't reset to false at 00:00:01 as it would only flash up for a second! I can see how you trigger the midnight billboard but can't see a patch that will set and forget? rather than constantly reacting to the current time.

thanks again, Kenny

randall's picture
Re: Conditional Logic?

When I'm dealing with a situation like this, I tend to go to a "lazy route" and write a controller in JavaScript to handle things like you're talking about. I have all the variables go into the controller, and then i write all the logic required inside of the JS patch, with a lot of boolean outs that say things like "start timer" and "start movie" etc.

I'm not sure that's a ton of help, especially if you're unfamiliar with JS, but thought I'd give you some extra perspective.

Thanks, rb

randall's picture
Re: Conditional Logic?

You could try "sample and hold." Not sure it's exactly what you're looking for, but I'd start looking there.

kennyhorn's picture
Re: Conditional Logic?

unfortunately I'm not familiar with JS, but sample & hold sounds like it might be what I'm looking for.

thanks

gtoledo3's picture
Re: Conditional Logic?

If your Conditional turns true and it is connected to a Counter, the Counter would stay at 1 after the Conditional goes back to false.

kennyhorn's picture
Re: Conditional Logic?

I've finally got the attached composition to work (kind of!)...

So up to an Hour before midnight is shows hh:mm:ss countdown, then in the final hour mm:ss, then in the last minute just the seconds, on midnight it plays a QT called movie.mov.

I've used a "sample & Hold" and a few messy noodles to make sure it sticks! If you run once, you have to explicitly stop and start the composition to clear the held value and reset.

There's about a 2 second lag when starting the QT file but this was partly due to using a long GOP codec and is significantly reduced by using an Intra frame codec and seems fast enough to be passable! (i.e avoiding a long hold on the final second!!)

I'd really appreciate if someone could have a quick look over and see if theres anything mad going on. I'll be projecting this to a few hundred people! my plan is to use QT to play the .qtz file as it seems to run fullscreen on a second display quite nicely.

and lastly does anyone have a good resource for reading up on the basics of the patches etc etc, i'm trying to get a better understanding for billboard vs sprites, image width/render size vs real size, units/pixels/font sizes! The info on the Apple site seems pretty basic/vague but then jumps to advanced use with Xcode etc etc

Thanks, Kenny

PreviewAttachmentSize
Countdown 03.qtz16.65 KB

gtoledo3's picture
Re: Conditional Logic?

That looks like clean work. It looks like it will all work well if the math for your countdown time was right (I didn't check). The movie I used started playing for me without any lag at all (mov, H264, 1280x720...it's just what was handy).

The Apple Mailing List Archives for Quartz Composer, is really almost like a big book. If you start looking at it from the front, you see tons of the basic questions... which makes sense, because it was all new! That's a really good resource, though the structure is a mailing list.

Billboards don't have options for rotating in "3D". They are strictly 2D - up/down/left/right. A Sprite can move in 3D space.

1 QC unit is half of the current width of the Viewer screen. A pixel is, a pixel (I can't think of any good way to explain that one).

If you have a source image that is 640x480, you could attach that to a Billboard or Sprite, and "size it up" to "Rendering Destination Dimensions", which is the current size of the Viewer space. The Rendering Destination Dimensions patch will give you unit and pixel output values.

Image Dimension is the pixel width and height, and current QC unit w/h, of the actual source image.

QC Units are useful so that you can layout something and go "no matter how big this Viewer gets, I want this to go all the way across".

Working in raw pixels is useful for scenarios where you need to make sure images stay the same resolution no matter how big/small the QC Viewer window gets.

randall's picture
Re: Conditional Logic?

The only place I've been using to read up (granted, I'm a noob too!) is just the patch library. I've been doing "studies" of different concepts, just like an artist might do a lighting study, I've been doing timing studies and mograph studies, etc. For each study, I just read through every patch figuring out which one could do the job best.

Good luck!

kennyhorn's picture
Re: Conditional Logic?

cheers for the detailed reply, appreciate you time/guidance

Kenny