Lookup tables in Quartz..

mrpackethead's picture

How can do I a lookup table?

I basically want to take a variable between 1 and 128 ( midi notes ), and transform them to use as an index for a multiplexer.. However this could be really useful for all sorts of things.

psonice's picture
Re: Lookup tables in Quartz..

Depends on how complex you want the LUT to be. If you just want to map it to a range (so 0-15 selects input 0, 16-31 selects 1 etc.) just use a math patch to scale and offset it.

If you want more complex behaviour (so each input controls several different things in different ways perhaps) a javascript patch is best.

toneburst's picture
Re: Lookup tables in Quartz..

In this case though, can't you just connect the input directly to the Multiplexer? It should round the number to an integer, if necessary, and just transparently switch inputs.

a|x

mrpackethead's picture
Re: Lookup tables in Quartz..

Yes, perhaps its time i figure out how to put together some java-scripts. No doubt i'll ahve other things that will need this as well.

Its not quite as simple as 'scaling' a range unfortunatly,

Do you know where i can find some good references to producing a java-script for quartz?

toneburst's picture
Re: Lookup tables in Quartz..

From Kineme's very own cybero http://www.cybero.co.uk/QuartzComposerJavaScriptGuide-Eng/index.html

JS in Quartz Composer is essentially the same as JS in anything else, with the obvious omission of all the browser DOM stuff, so a lot of the JavaScript resources out there on the www are useful when it comes to using QC, too.

a|x

dust's picture
Re: Lookup tables in Quartz..

actually i just did this today. the best solution is a javascript if statment but sometimes you don't things that complex. the simple solution is to get kinemes midi tools. then you hook a global note follower to a math patch and subract to get you index. example lets say your midi note is 18 and you want midi note 18 to be index 0 of your multiplexer then subtract 18-18 = 0 then any note higher than 18 will end up as an index like lets say the next key up 19 - 18 = 1 your second index etc... im pretty sure anything below midi 18 will act as 0 but ???? im actually doing this today hooking up a ipod to select different patches to be crossfaded with other patches etc. see pic.

PreviewAttachmentSize
Picture 1.png
Picture 1.png367.65 KB

mrpackethead's picture
Re: Lookup tables in Quartz..

thanks dust.. I used your 'hack' and it worked pretty well. However i'm still thinking i should learn some javascripts.