A sketchy implementation of cubehelix color scheme algorithm for Max/MSP/Jitter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
2.0 KiB

3 years ago
# Cubehelix for Max
7 months ago
By Théophile Clet - september, 2023. First version from 2021.
3 years ago
https://tflcl.xyz
7 months ago
![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\].
3 years ago
7 months ago
## 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)