Hybrid Visuals

Shaping the Random || Quartz Composer and other generative experiments

Posts Tagged ‘math’

  1. 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