Hybrid Visuals

Shaping the Random || Quartz Composer and other generative experiments

Linear Value Translation qcClip

This is a Quartz Composer Clip macro, that allows for a linear translation of a variable number. Basically you can use it to translate a number within a certain range (say [0,1]) to a new range (say [-1,1]). Fill in the old and new ranges, and attach the input. The patch will take care of the math for you.

Place the .qtz file in ~yourhomefolder/Library/Application Support/Apple/Developer Tools/Quartz Composer/Clips. It should then be available from the patch creator window.

Inputs:
value – the value to be translated
oldMin – the old minimum of the value (ie 0)
oldMax – the old maximum of the value (ie 1)
newMin – the new minimum of the value (ie -1)
newMax – the new maximum of the value (ie 1)

linear value translation.qtz

 

2 Responses to “Linear Value Translation qcClip” (post new)

  1.  

    just want to thank you for this little qtz patch. found it on a thread re: qtz math and scaling numbers at the vidvox.net forums (cant find the thread now).

    this has made a qtz project im working on SO much easier. it saved me at least a day of work. dave explained the math equation, but i only got about half of it.

    so thanks again.

  2.  

    You’re welcome, glad you like it!

Leave a Reply