textmode.synth.js
A derivative work of hydra-synth by Olivia Jack, adapted for the textmode.js ecosystem, providing a visual synthesis system for procedural generation of characters, colors, and visual effects through method chaining.
Example
javascript
const t = textmode.create({
width: window.innerWidth,
height: window.innerHeight,
plugins: [SynthPlugin]
});
const synth = noise(8)
.rotate(0.2)
.kaleid(5)
.charColor(osc(6, 0.1, 1.2))
.cellColor(osc(6, 0.1, 1.2).invert())
.charMap('@#%*+=-:. ');
t.layers.base.synth(synth);
t.windowResized(() => {
t.resizeCanvas(window.innerWidth, window.innerHeight);
});Classes
| Class | Description |
|---|---|
| SynthSource | A chainable synthesis source that accumulates transforms to be compiled into a shader. |
Interfaces
| Interface | Description |
|---|---|
| SynthContext | Context passed to dynamic parameter functions during rendering. |
| ModulatedArray | Extended array interface with modulation methods. |
Type Aliases
| Type Alias | Description |
|---|---|
| SynthParameterValue | Dynamic parameter value types supported by the synth system. |
| EasingFunction | Easing functions from https://gist.github.com/gre/1650294 |
| DynamicErrorCallback | Callback signature for dynamic parameter evaluation errors. Live coding environments can use this to display errors without interrupting rendering. |
Variables
| Variable | Description |
|---|---|
| SynthPlugin | The textmode.synth.js plugin to install. |
Functions
| Function | Description |
|---|---|
| cellColor | Create a synth source with cell background color defined. |
| char | Create a character source from any color/pattern source. |
| charColor | Create a synth source with character foreground color defined. |
| gradient | Generate a rotating radial gradient. |
| noise | Generate Perlin noise patterns. |
| plasma | Generate plasma-like sine field patterns. |
| moire | Generate moire interference patterns. |
| osc | Generate oscillating patterns using sine waves. |
| paint | Create a synth source with both character and cell colors defined. |
| shape | Generate geometric shapes (polygons). |
| solid | Generate a solid grayscale color. |
| src | Sample a source for synth compositions. |
| voronoi | Generate voronoi patterns. |
| setGlobalErrorCallback | Set a global error callback for dynamic parameter evaluation errors. |