Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One-time Events




On Jul 15, 2006, at 6:32 AM, email@hidden wrote:

Coolidge Corner wrote:
For example, striking a key causes ONE random number to be sent to an input of a particular patch.

But Random seems to output a continuous stream of numbers. How to hold its value after the first number is output?
I'd use a javascript patch like this:

if(inputs[0]) {outputs[0] = Math.random()};

if you connect your keyboard patch (and nothing else) to that node's input, it will only change when you hit the corresponding key.


Another approach would be to connect the keyboard patch to a counter which is connected to the patch time of a random patch whose variability is set to 0.0. In this way you are offsetting the sample position in the random patch and thus producing a random number per keystroke press.



Even better would be if the event that triggered this could be the start of the composition running. Is there some kind of "start" event I can make use of?
check if the patch time equals zero (conditional + patch time)

Convert your composition to a macro and externalize its timebase. Then you can start/stop the macro with a stop watch patch.
.xX



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


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >One-time Events (From: Coolidge Corner <email@hidden>)
 >Re: One-time Events (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.