diff --git a/README.md b/README.md index b9805a4..a1dfe02 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,27 @@ # Cubehelix for Max -By Théophile Clet - 2021-05-13 +By Théophile Clet - september, 2023. First version from 2021. https://tflcl.xyz -Original work and js code by Dave Green -http://www.mrao.cam.ac.uk/~dag/CUBEHELIX +![jit.cubehelix.ui](img/jit.cubehelix.ui.png) +## What is this +This is an implementation of cubehelix color palette generator algorithm for Cycling74```s Max. +It consists of a few files: +- ```cubehelix.genjit``` which is the "low-level" code for cubehlix calculation in the jit world +- ```jit.cubehelix.maxpat```, an abstraction wrapping ```cubehelix.genjit``` as a patcher with some added features for convenience: initialization with attributes, accepts inputs for both ranges (like the D3 implementation) and legacy parameters (start, rotation), converts output matrix... +- ```jit.cubehelix.maxhelp```, the help file for the \[jit.cubehelix\] abstraction, with examples and explanations +- ```jit.cubehelix.ui.maxpat```, which is basically a wrapper for \[jit.cubehelix\] with an user interface (can be used as a \[bpatcher\]), randomization capabilities and preset handling (using the pattr system). +- ```knob-range.js```, a custom \[jsui\] knob made for \[jit.cubehelix.ui\] but which can be repurposed for other things. It allows to set a custom output range, randomize the value in an inner range that can be modified with ctrl+drag (change offset) and option/alt+drag (change width). Holding shift allows fine tuning. +- ```cubehelixui-default```, some default presets for \[jit.cubehelix.ui\]. -Green, D. A., 2011, `A colour scheme for the display of astronomical intensity images', Bulletin of the Astronomical Society of India, 39, 289. -http://astron-soc.in/bulletin/11June/289392011.pdf +## How to use +1. Clone this repo +2. Put the folder in your Max search paths +3. Start patching. \[jit.cubehelix\] and its helper file are a good starting point. + +## Credits +Heavily based on [@mbostock cubehelix implementation in D3.js](https://github.com/d3/d3-plugins/tree/master/cubehelix). + +Original cubehelix by Dave Green: [Green, D. A., 2011, "A colour scheme for the display of astronomical intensity images", *Bulletin of the Astronomical Society of India*, 39, 289.](http://astron-soc.in/bulletin/11June/289392011.pdf) + +![jit.cubehelix helper file example 1](img/jit.cubehelix.maxhelp.1.png) +![jit.cubehelix helper file example 2](img/jit.cubehelix.maxhelp.2.png) diff --git a/img/jit.cubehelix.maxhelp.1.png b/img/jit.cubehelix.maxhelp.1.png new file mode 100644 index 0000000..5d9e582 Binary files /dev/null and b/img/jit.cubehelix.maxhelp.1.png differ diff --git a/img/jit.cubehelix.maxhelp.2.png b/img/jit.cubehelix.maxhelp.2.png new file mode 100644 index 0000000..734a480 Binary files /dev/null and b/img/jit.cubehelix.maxhelp.2.png differ diff --git a/img/jit.cubehelix.ui.png b/img/jit.cubehelix.ui.png new file mode 100644 index 0000000..8789548 Binary files /dev/null and b/img/jit.cubehelix.ui.png differ