Javascript

snerg's picture

Hi,

Does any one have some good resources on Javascript programming in QC?

I noticed some off the official examples don't use main functions and let you select how many inputs/outputs the javascript patch has.

However if I create a new javascript patch I can't get it to run without a main function and it never shows the options to specify the number of inputs/outputs, what am I doing wrong?

This is what I'm getting at:

http://iome.nl/javascript1.tiff http://iome.nl/javascript2.tiff

Snerg

Comment viewing options

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

cwright's picture
Tiger

The selectable inputs were only available on Tiger-made compositions -- on Leopard they're produced automatically.

It's perhaps possible to make a plugin that lets you create Tiger-based JS patches, if you'd like... not idea when I'd have a moment to take a look though.

tobyspark's picture
have you googled? the

have you googled? the quartzcompositions wiki page on javascript is pretty exhaustive as i recall.

and to clarify, in leopard the javascript patch was made much better, ie persistent variables are dealt with much more clearly and the whole named-and-typed input/output thing is brilliant. but as leopard qc will also play tiger comps, it will interpret tiger js patches in the tiger way. the upshot of which, is if you create the patch in leopard, it will behave as a leopard one. if you create it in tiger, it will be a tiger version whether loaded in leopard or tiger.

toby

snerg's picture
I know the wiki at

I know the wiki at quartzcompositions, I just feel I need some more examples on how to do things.

Maybe I should just fiddle around a bit more with the javascript patch and take more time looking at some examples.

Snerg

tobyspark's picture
sorry...

...didn't mean to sound patronising, shouldn't write these things without reading them back. what i should have said was that wiki page is about as comprehensive as anything i've seen, and beyond that google will get you javascript syntax / functions, which has been my main stumbling block.

snerg's picture
The wiki is a good starting

The wiki is a good starting point, I'll take it from there.

It's good to know why the two javascript patch versions are different (Tiger/Leopard), that answered my initial question.

Snerg