Rotating the write index also means that you will have to modulo your
index when reading if you intend to read more than the latest value.
Push and pop offer a very simple way of creating a queue. You push
onto the end of your array, test if your array has reached the desired
queue size and if so pop off the front of your array.
Declare this array outside of your main function and it will persist
across frames.
.xX
On Nov 14, 2007, at 9:07 AM, Jack Hayward <[EMAIL PROTECTED]>
wrote:
Fair enough - but how do I keep the array from getting initialized
every time the JSpatch runs?
I recently tried setting up a global variable and could not get it
to hold a value from one iteration to the next.
Or do I just have to create an output of type structure and assign
the array to it?
J
On Nov 14, 2007, at Nov 14, 2007 | 1:22 AM,
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:
You don't need any push/pop.
Just keep an array the size of the queue and rotate the write index
by
incrementing it like this:
i = (i + 1) % myArray.length;
Ambroise
-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
] De
la part de Jack Hayward
Envoyé : mercredi 14 novembre 2007 10:13
À : Alessandro Sabatelli
Cc : [email protected]
Objet : Re: Is it possible to build a queue in composer?
I can't seem to locate the JS on composer documentation - anyone
have a pointer?
I found a few things on the web for JS in general, but none of them
talk about push and pop.
J
On Nov 13, 2007, at Nov 13, 2007 | 2:04 PM, Alessandro Sabatelli
wrote:
You can do this in JS onTiger. Use push and pop methods on your
array to create the queue.
.xX
On Nov 12, 2007, at 12:46 PM, Jack Hayward
<[EMAIL PROTECTED]> wrote:
I would like to build a queue containing the last "n" MIDID notes
that have come in.
Any ideas on how to do this?
Thanks
Jack
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (Quartzcomposer-
[EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/
asabatelli%40apple.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/ambroise%40cellulo
.info
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/asabatelli%40apple.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]