@nexart/codemode-sdk 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +221 -9
  3. package/dist/core-index.d.ts +1 -1
  4. package/dist/core-index.js +1 -1
  5. package/dist/entry/browser.d.ts +43 -0
  6. package/dist/entry/browser.d.ts.map +1 -0
  7. package/dist/entry/browser.js +63 -0
  8. package/dist/entry/node.d.ts +23 -0
  9. package/dist/entry/node.d.ts.map +1 -0
  10. package/dist/entry/node.js +34 -0
  11. package/dist/index.d.ts +14 -33
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +41 -33
  14. package/dist/runtime.d.ts +52 -0
  15. package/dist/runtime.d.ts.map +1 -0
  16. package/dist/runtime.js +219 -0
  17. package/dist/sdk/codemode/builder-manifest.d.ts +79 -0
  18. package/dist/sdk/codemode/builder-manifest.d.ts.map +1 -0
  19. package/dist/sdk/codemode/builder-manifest.js +97 -0
  20. package/dist/sdk/codemode/core-index.d.ts +21 -0
  21. package/dist/sdk/codemode/core-index.d.ts.map +1 -0
  22. package/dist/sdk/codemode/core-index.js +26 -0
  23. package/dist/sdk/codemode/engine.d.ts +24 -0
  24. package/dist/sdk/codemode/engine.d.ts.map +1 -0
  25. package/dist/sdk/codemode/engine.js +67 -0
  26. package/dist/sdk/codemode/execute.d.ts +46 -0
  27. package/dist/sdk/codemode/execute.d.ts.map +1 -0
  28. package/dist/sdk/codemode/execute.js +283 -0
  29. package/dist/sdk/codemode/execution-sandbox.d.ts +107 -0
  30. package/dist/sdk/codemode/execution-sandbox.d.ts.map +1 -0
  31. package/dist/sdk/codemode/execution-sandbox.js +207 -0
  32. package/dist/sdk/codemode/index.d.ts +31 -0
  33. package/dist/sdk/codemode/index.d.ts.map +1 -0
  34. package/dist/sdk/codemode/index.js +63 -0
  35. package/dist/sdk/codemode/loop-engine.d.ts +22 -0
  36. package/dist/sdk/codemode/loop-engine.d.ts.map +1 -0
  37. package/dist/sdk/codemode/loop-engine.js +229 -0
  38. package/dist/sdk/codemode/noise-bridge.d.ts +44 -0
  39. package/dist/sdk/codemode/noise-bridge.d.ts.map +1 -0
  40. package/dist/sdk/codemode/noise-bridge.js +68 -0
  41. package/dist/sdk/codemode/noise-engine.d.ts +74 -0
  42. package/dist/sdk/codemode/noise-engine.d.ts.map +1 -0
  43. package/dist/sdk/codemode/noise-engine.js +132 -0
  44. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts +11 -0
  45. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts.map +1 -0
  46. package/dist/sdk/codemode/noise-sketches/fractalNoise.js +121 -0
  47. package/dist/sdk/codemode/noise-sketches/index.d.ts +21 -0
  48. package/dist/sdk/codemode/noise-sketches/index.d.ts.map +1 -0
  49. package/dist/sdk/codemode/noise-sketches/index.js +28 -0
  50. package/dist/sdk/codemode/p5-runtime.d.ts +75 -0
  51. package/dist/sdk/codemode/p5-runtime.d.ts.map +1 -0
  52. package/dist/sdk/codemode/p5-runtime.js +1031 -0
  53. package/dist/sdk/codemode/sound-bridge.d.ts +89 -0
  54. package/dist/sdk/codemode/sound-bridge.d.ts.map +1 -0
  55. package/dist/sdk/codemode/sound-bridge.js +128 -0
  56. package/dist/sdk/codemode/soundart-engine.d.ts +87 -0
  57. package/dist/sdk/codemode/soundart-engine.d.ts.map +1 -0
  58. package/dist/sdk/codemode/soundart-engine.js +173 -0
  59. package/dist/sdk/codemode/soundart-sketches/chladniBloom.d.ts +3 -0
  60. package/dist/sdk/codemode/soundart-sketches/chladniBloom.d.ts.map +1 -0
  61. package/dist/sdk/codemode/soundart-sketches/chladniBloom.js +53 -0
  62. package/dist/sdk/codemode/soundart-sketches/dualVortex.d.ts +3 -0
  63. package/dist/sdk/codemode/soundart-sketches/dualVortex.d.ts.map +1 -0
  64. package/dist/sdk/codemode/soundart-sketches/dualVortex.js +67 -0
  65. package/dist/sdk/codemode/soundart-sketches/geometryIllusion.d.ts +3 -0
  66. package/dist/sdk/codemode/soundart-sketches/geometryIllusion.d.ts.map +1 -0
  67. package/dist/sdk/codemode/soundart-sketches/geometryIllusion.js +89 -0
  68. package/dist/sdk/codemode/soundart-sketches/index.d.ts +39 -0
  69. package/dist/sdk/codemode/soundart-sketches/index.d.ts.map +1 -0
  70. package/dist/sdk/codemode/soundart-sketches/index.js +72 -0
  71. package/dist/sdk/codemode/soundart-sketches/isoflow.d.ts +3 -0
  72. package/dist/sdk/codemode/soundart-sketches/isoflow.d.ts.map +1 -0
  73. package/dist/sdk/codemode/soundart-sketches/isoflow.js +60 -0
  74. package/dist/sdk/codemode/soundart-sketches/loomWeave.d.ts +3 -0
  75. package/dist/sdk/codemode/soundart-sketches/loomWeave.d.ts.map +1 -0
  76. package/dist/sdk/codemode/soundart-sketches/loomWeave.js +59 -0
  77. package/dist/sdk/codemode/soundart-sketches/noiseTerraces.d.ts +3 -0
  78. package/dist/sdk/codemode/soundart-sketches/noiseTerraces.d.ts.map +1 -0
  79. package/dist/sdk/codemode/soundart-sketches/noiseTerraces.js +53 -0
  80. package/dist/sdk/codemode/soundart-sketches/orb.d.ts +3 -0
  81. package/dist/sdk/codemode/soundart-sketches/orb.d.ts.map +1 -0
  82. package/dist/sdk/codemode/soundart-sketches/orb.js +50 -0
  83. package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.d.ts +3 -0
  84. package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.d.ts.map +1 -0
  85. package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.js +72 -0
  86. package/dist/sdk/codemode/soundart-sketches/prismFlowFields.d.ts +3 -0
  87. package/dist/sdk/codemode/soundart-sketches/prismFlowFields.d.ts.map +1 -0
  88. package/dist/sdk/codemode/soundart-sketches/prismFlowFields.js +51 -0
  89. package/dist/sdk/codemode/soundart-sketches/radialBurst.d.ts +3 -0
  90. package/dist/sdk/codemode/soundart-sketches/radialBurst.d.ts.map +1 -0
  91. package/dist/sdk/codemode/soundart-sketches/radialBurst.js +60 -0
  92. package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.d.ts +3 -0
  93. package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.d.ts.map +1 -0
  94. package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.js +89 -0
  95. package/dist/sdk/codemode/soundart-sketches/rings.d.ts +11 -0
  96. package/dist/sdk/codemode/soundart-sketches/rings.d.ts.map +1 -0
  97. package/dist/sdk/codemode/soundart-sketches/rings.js +89 -0
  98. package/dist/sdk/codemode/soundart-sketches/squares.d.ts +3 -0
  99. package/dist/sdk/codemode/soundart-sketches/squares.d.ts.map +1 -0
  100. package/dist/sdk/codemode/soundart-sketches/squares.js +52 -0
  101. package/dist/sdk/codemode/soundart-sketches/waveStripes.d.ts +3 -0
  102. package/dist/sdk/codemode/soundart-sketches/waveStripes.d.ts.map +1 -0
  103. package/dist/sdk/codemode/soundart-sketches/waveStripes.js +44 -0
  104. package/dist/sdk/codemode/static-engine.d.ts +20 -0
  105. package/dist/sdk/codemode/static-engine.d.ts.map +1 -0
  106. package/dist/sdk/codemode/static-engine.js +144 -0
  107. package/dist/sdk/codemode/types.d.ts +191 -0
  108. package/dist/sdk/codemode/types.d.ts.map +1 -0
  109. package/dist/sdk/codemode/types.js +32 -0
  110. package/dist/shared/noiseSnapshot.d.ts +59 -0
  111. package/dist/shared/noiseSnapshot.d.ts.map +1 -0
  112. package/dist/shared/noiseSnapshot.js +72 -0
  113. package/dist/shared/soundSnapshot.d.ts +94 -0
  114. package/dist/shared/soundSnapshot.d.ts.map +1 -0
  115. package/dist/shared/soundSnapshot.js +128 -0
  116. package/dist/static-engine.d.ts.map +1 -1
  117. package/dist/static-engine.js +24 -11
  118. package/examples/basic.ts +61 -0
  119. package/examples/preflight-test.ts +275 -0
  120. package/examples/verify.ts +151 -0
  121. package/package.json +45 -5
@@ -0,0 +1,89 @@
1
+ export const GEOMETRY_ILLUSION_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const hueBase = map(S.hue, 0, 100, 0, 360);
14
+ const hueVar = map(S.treble, 0, 100, 20, 240);
15
+ const sizeScale = map(S.volume, 0, 100, 0.05, 1.8);
16
+ const rotAmt = map(S.aggression, 0, 100, 0, PI / 3);
17
+ const layers = Math.floor(map(S.length, 0, 100, 120, 900));
18
+ const alphaLevel = map(S.amplitude, 0, 100, 0.25, 1.3);
19
+ const lineCount = Math.floor(map(S.rhythmicity, 0, 100, 40, 600));
20
+ const strokeW = map(S.attack, 0, 100, 0.5, 6.5);
21
+ const distort = map(S.harmonicity, 0, 100, 0, 70);
22
+ const bias = map(S.mid, 0, 100, 0, 1);
23
+ const bright = map(S.brightness, 0, 100, 0.4, 2.2);
24
+ const sat = map(S.chroma, 0, 100, 0.4, 5.4);
25
+ const cont = map(S.dynamicRange, 0, 100, 0.5, 3.4);
26
+ const layerDepth = map(S.harmonicity, 0, 100, 0.2, 2.2);
27
+
28
+ const baseScale = map(S.volume, 0, 100, 0.5, 1.1);
29
+ const densityScale = map(S.length, 0, 100, 0.9, 0.7);
30
+ const scaleFactor = constrain(baseScale * densityScale, 0.6, 1.0);
31
+
32
+ translate(width / 2, height / 2);
33
+ scale(scaleFactor, scaleFactor);
34
+
35
+ const combined = S.rhythmicity * 0.6 + S.harmonicity * 0.4;
36
+ const spacingFactor = map(combined, 0, 100, 2.5, 0.3);
37
+ const spacingAmp = map(S.volume, 0, 100, 0.3, 1.2);
38
+
39
+ for (let i = 0; i < layers; i++) {
40
+ push();
41
+ rotate((random() - 0.5) * rotAmt * 2);
42
+
43
+ const w = random() * width * sizeScale;
44
+ const h = random() * height * sizeScale;
45
+
46
+ translate(
47
+ (random() - 0.5) * width * spacingFactor * spacingAmp,
48
+ (random() - 0.5) * height * spacingFactor * spacingAmp
49
+ );
50
+
51
+ const hue = (hueBase + random() * hueVar - hueVar / 2 + 360) % 360;
52
+ const fillSat = constrain(60 * sat, 0, 100);
53
+ const fillLight = constrain(60 * bright * cont, 0, 100);
54
+ const strokeLight = constrain(30 * cont, 0, 100);
55
+
56
+ fill(hslColor(hue, fillSat, fillLight, alphaLevel * layerDepth));
57
+ stroke(hslColor(hue, fillSat * 0.6, strokeLight, alphaLevel));
58
+ strokeWeight(strokeW);
59
+
60
+ const rectW = w * (bias > 0.5 ? lerp(0.5, 1.0, random()) : lerp(0.1, 0.5, random()));
61
+ const rectH = h * (bias < 0.5 ? lerp(0.5, 1.0, random()) : lerp(0.1, 0.5, random()));
62
+
63
+ rect(
64
+ -rectW / 2 + (random() - 0.5) * distort,
65
+ -rectH / 2 + (random() - 0.5) * distort,
66
+ rectW,
67
+ rectH
68
+ );
69
+ pop();
70
+ }
71
+
72
+ noFill();
73
+ stroke(hslColor(hueBase, 25, 75, 0.25));
74
+ strokeWeight(1);
75
+ for (let i = 0; i < lineCount; i++) {
76
+ const x1 = random() * width - width / 2;
77
+ const y1 = random() * height - height / 2;
78
+ const x2 = x1 + lerp(-100, 100, random());
79
+ const y2 = y1 + lerp(-100, 100, random());
80
+ line(x1, y1, x2, y2);
81
+ }
82
+ }
83
+
84
+ function hslColor(h, s, l, a) {
85
+ if (a !== undefined) return 'hsla(' + h + ',' + s + '%,' + l + '%,' + a + ')';
86
+ return 'hsl(' + h + ',' + s + '%,' + l + '%)';
87
+ }
88
+ `;
89
+ export default GEOMETRY_ILLUSION_SKETCH;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * SoundArt Sketches Index
3
+ *
4
+ * All SoundArt styles converted to Code Mode sketches.
5
+ * Each sketch uses S.* globals for sound-derived parameters.
6
+ */
7
+ export type SoundArtSketchName = 'rings' | 'pixelGlyphs' | 'radialBurst' | 'orb' | 'waveStripes' | 'squares' | 'loomWeave' | 'noiseTerraces' | 'prismFlowFields' | 'chladniBloom' | 'dualVortex' | 'isoflow' | 'geometryIllusion' | 'resonantSoundBodies';
8
+ /**
9
+ * Map of all available SoundArt sketches
10
+ * Each sketch is a string containing Code Mode compatible code
11
+ */
12
+ export declare const SOUNDART_SKETCHES: Record<SoundArtSketchName, string>;
13
+ /**
14
+ * Get a SoundArt sketch by name
15
+ */
16
+ export declare function getSoundArtSketch(name: SoundArtSketchName): string | undefined;
17
+ /**
18
+ * Get list of available (converted) SoundArt sketches
19
+ */
20
+ export declare function getAvailableSoundArtSketches(): SoundArtSketchName[];
21
+ /**
22
+ * Check if a SoundArt sketch has been converted to Code Mode
23
+ */
24
+ export declare function isSoundArtSketchAvailable(name: SoundArtSketchName): boolean;
25
+ export { RINGS_SKETCH } from './rings';
26
+ export { PIXEL_GLYPHS_SKETCH } from './pixelGlyphs';
27
+ export { RADIAL_BURST_SKETCH } from './radialBurst';
28
+ export { ORB_SKETCH } from './orb';
29
+ export { WAVE_STRIPES_SKETCH } from './waveStripes';
30
+ export { SQUARES_SKETCH } from './squares';
31
+ export { LOOM_WEAVE_SKETCH } from './loomWeave';
32
+ export { NOISE_TERRACES_SKETCH } from './noiseTerraces';
33
+ export { PRISM_FLOW_FIELDS_SKETCH } from './prismFlowFields';
34
+ export { CHLADNI_BLOOM_SKETCH } from './chladniBloom';
35
+ export { DUAL_VORTEX_SKETCH } from './dualVortex';
36
+ export { ISOFLOW_SKETCH } from './isoflow';
37
+ export { GEOMETRY_ILLUSION_SKETCH } from './geometryIllusion';
38
+ export { RESONANT_SOUND_BODIES_SKETCH } from './resonantSoundBodies';
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,aAAa,GACb,aAAa,GACb,KAAK,GACL,aAAa,GACb,SAAS,GACT,WAAW,GACX,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAehE,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAE9E;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,kBAAkB,EAAE,CAEnE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAE3E;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * SoundArt Sketches Index
3
+ *
4
+ * All SoundArt styles converted to Code Mode sketches.
5
+ * Each sketch uses S.* globals for sound-derived parameters.
6
+ */
7
+ import { RINGS_SKETCH } from './rings';
8
+ import { PIXEL_GLYPHS_SKETCH } from './pixelGlyphs';
9
+ import { RADIAL_BURST_SKETCH } from './radialBurst';
10
+ import { ORB_SKETCH } from './orb';
11
+ import { WAVE_STRIPES_SKETCH } from './waveStripes';
12
+ import { SQUARES_SKETCH } from './squares';
13
+ import { LOOM_WEAVE_SKETCH } from './loomWeave';
14
+ import { NOISE_TERRACES_SKETCH } from './noiseTerraces';
15
+ import { PRISM_FLOW_FIELDS_SKETCH } from './prismFlowFields';
16
+ import { CHLADNI_BLOOM_SKETCH } from './chladniBloom';
17
+ import { DUAL_VORTEX_SKETCH } from './dualVortex';
18
+ import { ISOFLOW_SKETCH } from './isoflow';
19
+ import { GEOMETRY_ILLUSION_SKETCH } from './geometryIllusion';
20
+ import { RESONANT_SOUND_BODIES_SKETCH } from './resonantSoundBodies';
21
+ /**
22
+ * Map of all available SoundArt sketches
23
+ * Each sketch is a string containing Code Mode compatible code
24
+ */
25
+ export const SOUNDART_SKETCHES = {
26
+ rings: RINGS_SKETCH,
27
+ pixelGlyphs: PIXEL_GLYPHS_SKETCH,
28
+ radialBurst: RADIAL_BURST_SKETCH,
29
+ orb: ORB_SKETCH,
30
+ waveStripes: WAVE_STRIPES_SKETCH,
31
+ squares: SQUARES_SKETCH,
32
+ loomWeave: LOOM_WEAVE_SKETCH,
33
+ noiseTerraces: NOISE_TERRACES_SKETCH,
34
+ prismFlowFields: PRISM_FLOW_FIELDS_SKETCH,
35
+ chladniBloom: CHLADNI_BLOOM_SKETCH,
36
+ dualVortex: DUAL_VORTEX_SKETCH,
37
+ isoflow: ISOFLOW_SKETCH,
38
+ geometryIllusion: GEOMETRY_ILLUSION_SKETCH,
39
+ resonantSoundBodies: RESONANT_SOUND_BODIES_SKETCH,
40
+ };
41
+ /**
42
+ * Get a SoundArt sketch by name
43
+ */
44
+ export function getSoundArtSketch(name) {
45
+ return SOUNDART_SKETCHES[name];
46
+ }
47
+ /**
48
+ * Get list of available (converted) SoundArt sketches
49
+ */
50
+ export function getAvailableSoundArtSketches() {
51
+ return Object.keys(SOUNDART_SKETCHES);
52
+ }
53
+ /**
54
+ * Check if a SoundArt sketch has been converted to Code Mode
55
+ */
56
+ export function isSoundArtSketchAvailable(name) {
57
+ return name in SOUNDART_SKETCHES;
58
+ }
59
+ export { RINGS_SKETCH } from './rings';
60
+ export { PIXEL_GLYPHS_SKETCH } from './pixelGlyphs';
61
+ export { RADIAL_BURST_SKETCH } from './radialBurst';
62
+ export { ORB_SKETCH } from './orb';
63
+ export { WAVE_STRIPES_SKETCH } from './waveStripes';
64
+ export { SQUARES_SKETCH } from './squares';
65
+ export { LOOM_WEAVE_SKETCH } from './loomWeave';
66
+ export { NOISE_TERRACES_SKETCH } from './noiseTerraces';
67
+ export { PRISM_FLOW_FIELDS_SKETCH } from './prismFlowFields';
68
+ export { CHLADNI_BLOOM_SKETCH } from './chladniBloom';
69
+ export { DUAL_VORTEX_SKETCH } from './dualVortex';
70
+ export { ISOFLOW_SKETCH } from './isoflow';
71
+ export { GEOMETRY_ILLUSION_SKETCH } from './geometryIllusion';
72
+ export { RESONANT_SOUND_BODIES_SKETCH } from './resonantSoundBodies';
@@ -0,0 +1,3 @@
1
+ export declare const ISOFLOW_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const cx = width / 2;\n const cy = height / 2;\n const maxRadius = min(width, height) * 0.6;\n const layers = 3;\n const burstsPerLayer = Math.floor(map(S.rhythmicity, 0, 100, 20, 40));\n\n noFill();\n\n for (let l = 0; l < layers; l++) {\n const hue = map(l === 0 ? S.bass : (l === 1 ? S.brightness : S.treble), 0, 100, 0, 360);\n const alpha = map(l === 0 ? S.volume : (l === 1 ? S.aggression : S.dynamicRange), 0, 100, 0.7, 1);\n const sat = 85 + random() * 15;\n \n stroke('hsla(' + hue + ',' + sat + '%,95%,' + alpha + ')');\n strokeWeight(map(S.volume + l * 10, 0, 130, 1.2, 4.8));\n \n const radiusScale = map(S.dynamicRange + l * 20, 0, 150, 0.8, 1.4);\n const noiseAmp = map(S.aggression, 0, 100, 0.5, 3.0);\n const swirl = map(S.treble + l * 20, 0, 150, 0.3, 1.5);\n const rotSkew = map(S.harmonicity, 0, 100, -0.5, 0.5);\n const deformSkew = map(S.attack, 0, 100, -PI * 0.4, PI * 0.4);\n const centerJitter = map(S.bass, 0, 100, -60, 60);\n\n for (let b = 0; b < burstsPerLayer; b++) {\n const baseAngle = map(b + l * burstsPerLayer, 0, layers * burstsPerLayer, 0, PI * 2);\n const burstCount = Math.floor(map(S.volume + S.rhythmicity, 0, 200, 30, 90));\n \n for (let j = 0; j < burstCount; j++) {\n const angle = baseAngle + map(j, 0, burstCount, -0.02, 0.02);\n const ox = cx + cos(angle) * centerJitter;\n const oy = cy + sin(angle) * centerJitter;\n \n beginShape();\n for (let r0 = 0; r0 < maxRadius * radiusScale; r0 += 3) {\n const normR = r0 / maxRadius;\n const n = noise(cos(angle + rotSkew) * normR * noiseAmp, sin(angle + swirl) * normR * noiseAmp);\n const deform = map(n, 0, 1, -PI * swirl, PI * swirl) + deformSkew;\n const px = ox + cos(angle + deform) * r0;\n const py = oy + sin(angle + deform) * r0;\n vertex(px, py);\n }\n endShape();\n }\n }\n }\n}\n";
2
+ export default ISOFLOW_SKETCH;
3
+ //# sourceMappingURL=isoflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isoflow.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/isoflow.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,g2EA0D1B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,60 @@
1
+ export const ISOFLOW_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const cx = width / 2;
14
+ const cy = height / 2;
15
+ const maxRadius = min(width, height) * 0.6;
16
+ const layers = 3;
17
+ const burstsPerLayer = Math.floor(map(S.rhythmicity, 0, 100, 20, 40));
18
+
19
+ noFill();
20
+
21
+ for (let l = 0; l < layers; l++) {
22
+ const hue = map(l === 0 ? S.bass : (l === 1 ? S.brightness : S.treble), 0, 100, 0, 360);
23
+ const alpha = map(l === 0 ? S.volume : (l === 1 ? S.aggression : S.dynamicRange), 0, 100, 0.7, 1);
24
+ const sat = 85 + random() * 15;
25
+
26
+ stroke('hsla(' + hue + ',' + sat + '%,95%,' + alpha + ')');
27
+ strokeWeight(map(S.volume + l * 10, 0, 130, 1.2, 4.8));
28
+
29
+ const radiusScale = map(S.dynamicRange + l * 20, 0, 150, 0.8, 1.4);
30
+ const noiseAmp = map(S.aggression, 0, 100, 0.5, 3.0);
31
+ const swirl = map(S.treble + l * 20, 0, 150, 0.3, 1.5);
32
+ const rotSkew = map(S.harmonicity, 0, 100, -0.5, 0.5);
33
+ const deformSkew = map(S.attack, 0, 100, -PI * 0.4, PI * 0.4);
34
+ const centerJitter = map(S.bass, 0, 100, -60, 60);
35
+
36
+ for (let b = 0; b < burstsPerLayer; b++) {
37
+ const baseAngle = map(b + l * burstsPerLayer, 0, layers * burstsPerLayer, 0, PI * 2);
38
+ const burstCount = Math.floor(map(S.volume + S.rhythmicity, 0, 200, 30, 90));
39
+
40
+ for (let j = 0; j < burstCount; j++) {
41
+ const angle = baseAngle + map(j, 0, burstCount, -0.02, 0.02);
42
+ const ox = cx + cos(angle) * centerJitter;
43
+ const oy = cy + sin(angle) * centerJitter;
44
+
45
+ beginShape();
46
+ for (let r0 = 0; r0 < maxRadius * radiusScale; r0 += 3) {
47
+ const normR = r0 / maxRadius;
48
+ const n = noise(cos(angle + rotSkew) * normR * noiseAmp, sin(angle + swirl) * normR * noiseAmp);
49
+ const deform = map(n, 0, 1, -PI * swirl, PI * swirl) + deformSkew;
50
+ const px = ox + cos(angle + deform) * r0;
51
+ const py = oy + sin(angle + deform) * r0;
52
+ vertex(px, py);
53
+ }
54
+ endShape();
55
+ }
56
+ }
57
+ }
58
+ }
59
+ `;
60
+ export default ISOFLOW_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const LOOM_WEAVE_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const threadsX = Math.round(map(S.rhythmicity, 0, 100, 4, 22));\n const threadsY = Math.round(map(S.volume, 0, 100, 4, 22));\n const margin = map(S.dynamicRange, 0, 100, 80, 220);\n const threadW = map(S.amplitude, 0, 100, 8, 26);\n const noiseFreq = map(S.harmonicity, 0, 100, 0.012, 0.035);\n const noiseAmp = map(S.aggression, 0, 100, 8, 38);\n const hueBase = map(S.hue, 0, 100, 0, 360);\n const warpHue = hueBase;\n const weftHue = (hueBase + 180) % 360;\n const brightness = map(S.brightness, 0, 100, 45, 75);\n const chroma = map(S.chroma, 0, 100, 70, 95);\n const alphaVal = map(S.attack, 0, 100, 0.8, 1.0);\n\n noStroke();\n\n for (let i = 0; i < threadsX; i++) {\n const xBase = margin + (width - 2 * margin) * (i / max(1, threadsX - 1));\n fill('hsla(' + warpHue + ',' + chroma + '%,' + brightness + '%,' + alphaVal + ')');\n beginShape();\n for (let y = 0; y <= height; y += 16) {\n const dx = map(noise(i * 0.25, y * noiseFreq), 0, 1, -noiseAmp, noiseAmp);\n vertex(xBase + dx - threadW / 2, y);\n }\n for (let y = height; y >= 0; y -= 16) {\n const dx = map(noise(i * 0.37, y * noiseFreq + 200), 0, 1, -noiseAmp, noiseAmp);\n vertex(xBase + dx + threadW / 2, y);\n }\n endShape(CLOSE);\n }\n\n for (let j = 0; j < threadsY; j++) {\n const yBase = margin + (height - 2 * margin) * (j / max(1, threadsY - 1));\n fill('hsla(' + weftHue + ',' + chroma + '%,' + brightness + '%,' + alphaVal + ')');\n beginShape();\n for (let x = 0; x <= width; x += 16) {\n const dy = map(noise(j * 0.25, x * noiseFreq), 0, 1, -noiseAmp, noiseAmp);\n vertex(x, yBase + dy - threadW / 2);\n }\n for (let x = width; x >= 0; x -= 16) {\n const dy = map(noise(j * 0.37, x * noiseFreq + 200), 0, 1, -noiseAmp, noiseAmp);\n vertex(x, yBase + dy + threadW / 2);\n }\n endShape(CLOSE);\n }\n}\n";
2
+ export default LOOM_WEAVE_SKETCH;
3
+ //# sourceMappingURL=loomWeave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loomWeave.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/loomWeave.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,0wEAyD7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,59 @@
1
+ export const LOOM_WEAVE_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const threadsX = Math.round(map(S.rhythmicity, 0, 100, 4, 22));
14
+ const threadsY = Math.round(map(S.volume, 0, 100, 4, 22));
15
+ const margin = map(S.dynamicRange, 0, 100, 80, 220);
16
+ const threadW = map(S.amplitude, 0, 100, 8, 26);
17
+ const noiseFreq = map(S.harmonicity, 0, 100, 0.012, 0.035);
18
+ const noiseAmp = map(S.aggression, 0, 100, 8, 38);
19
+ const hueBase = map(S.hue, 0, 100, 0, 360);
20
+ const warpHue = hueBase;
21
+ const weftHue = (hueBase + 180) % 360;
22
+ const brightness = map(S.brightness, 0, 100, 45, 75);
23
+ const chroma = map(S.chroma, 0, 100, 70, 95);
24
+ const alphaVal = map(S.attack, 0, 100, 0.8, 1.0);
25
+
26
+ noStroke();
27
+
28
+ for (let i = 0; i < threadsX; i++) {
29
+ const xBase = margin + (width - 2 * margin) * (i / max(1, threadsX - 1));
30
+ fill('hsla(' + warpHue + ',' + chroma + '%,' + brightness + '%,' + alphaVal + ')');
31
+ beginShape();
32
+ for (let y = 0; y <= height; y += 16) {
33
+ const dx = map(noise(i * 0.25, y * noiseFreq), 0, 1, -noiseAmp, noiseAmp);
34
+ vertex(xBase + dx - threadW / 2, y);
35
+ }
36
+ for (let y = height; y >= 0; y -= 16) {
37
+ const dx = map(noise(i * 0.37, y * noiseFreq + 200), 0, 1, -noiseAmp, noiseAmp);
38
+ vertex(xBase + dx + threadW / 2, y);
39
+ }
40
+ endShape(CLOSE);
41
+ }
42
+
43
+ for (let j = 0; j < threadsY; j++) {
44
+ const yBase = margin + (height - 2 * margin) * (j / max(1, threadsY - 1));
45
+ fill('hsla(' + weftHue + ',' + chroma + '%,' + brightness + '%,' + alphaVal + ')');
46
+ beginShape();
47
+ for (let x = 0; x <= width; x += 16) {
48
+ const dy = map(noise(j * 0.25, x * noiseFreq), 0, 1, -noiseAmp, noiseAmp);
49
+ vertex(x, yBase + dy - threadW / 2);
50
+ }
51
+ for (let x = width; x >= 0; x -= 16) {
52
+ const dy = map(noise(j * 0.37, x * noiseFreq + 200), 0, 1, -noiseAmp, noiseAmp);
53
+ vertex(x, yBase + dy + threadW / 2);
54
+ }
55
+ endShape(CLOSE);
56
+ }
57
+ }
58
+ `;
59
+ export default LOOM_WEAVE_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const NOISE_TERRACES_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const levels = Math.floor(map(S.harmonicity, 0, 100, 6, 16));\n const res = Math.floor(map(S.brightness, 0, 100, 3, 10));\n\n const mainHue = (S.brightness * 3.6) % 360;\n const palette = [];\n for (let i = 0; i < 16; i++) {\n const h = (mainHue + i * 22.5) % 360;\n const sat = map(S.treble, 0, 100, 60, 90);\n const bri = map(S.bass, 0, 100, 70, 95);\n palette.push([h, sat, bri]);\n }\n\n noStroke();\n\n for (let lvl = 0; lvl < levels; lvl++) {\n const iso = lvl / levels;\n const [h, sat, bri] = palette[lvl % palette.length];\n const satBoost = map(S.treble, 0, 100, 1.0, 1.4);\n const alpha = lerp(0.95, 0.5, iso) * map(S.volume, 0, 100, 0.5, 1.0);\n \n fill(hslColor(h, constrain(sat * satBoost, 0, 100), bri, alpha));\n \n const scale = 0.012 + lvl * 0.0025;\n for (let x = 0; x < width; x += res) {\n for (let y = 0; y < height; y += res) {\n if (noise(x * scale, y * scale) > iso * map(S.rhythmicity, 0, 100, 3.4, 8.3)) {\n const rw = res * (0.9 + random() * 0.3);\n const rh = res * (0.9 + random() * 0.3);\n rect(x, y, rw, rh);\n }\n }\n }\n }\n}\n\nfunction hslColor(h, s, l, a) {\n if (a !== undefined) return 'hsla(' + h + ',' + s + '%,' + l + '%,' + a + ')';\n return 'hsl(' + h + ',' + s + '%,' + l + '%)';\n}\n";
2
+ export default NOISE_TERRACES_SKETCH;
3
+ //# sourceMappingURL=noiseTerraces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noiseTerraces.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/noiseTerraces.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,muDAmDjC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,53 @@
1
+ export const NOISE_TERRACES_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const levels = Math.floor(map(S.harmonicity, 0, 100, 6, 16));
14
+ const res = Math.floor(map(S.brightness, 0, 100, 3, 10));
15
+
16
+ const mainHue = (S.brightness * 3.6) % 360;
17
+ const palette = [];
18
+ for (let i = 0; i < 16; i++) {
19
+ const h = (mainHue + i * 22.5) % 360;
20
+ const sat = map(S.treble, 0, 100, 60, 90);
21
+ const bri = map(S.bass, 0, 100, 70, 95);
22
+ palette.push([h, sat, bri]);
23
+ }
24
+
25
+ noStroke();
26
+
27
+ for (let lvl = 0; lvl < levels; lvl++) {
28
+ const iso = lvl / levels;
29
+ const [h, sat, bri] = palette[lvl % palette.length];
30
+ const satBoost = map(S.treble, 0, 100, 1.0, 1.4);
31
+ const alpha = lerp(0.95, 0.5, iso) * map(S.volume, 0, 100, 0.5, 1.0);
32
+
33
+ fill(hslColor(h, constrain(sat * satBoost, 0, 100), bri, alpha));
34
+
35
+ const scale = 0.012 + lvl * 0.0025;
36
+ for (let x = 0; x < width; x += res) {
37
+ for (let y = 0; y < height; y += res) {
38
+ if (noise(x * scale, y * scale) > iso * map(S.rhythmicity, 0, 100, 3.4, 8.3)) {
39
+ const rw = res * (0.9 + random() * 0.3);
40
+ const rh = res * (0.9 + random() * 0.3);
41
+ rect(x, y, rw, rh);
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ function hslColor(h, s, l, a) {
49
+ if (a !== undefined) return 'hsla(' + h + ',' + s + '%,' + l + '%,' + a + ')';
50
+ return 'hsl(' + h + ',' + s + '%,' + l + '%)';
51
+ }
52
+ `;
53
+ export default NOISE_TERRACES_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const ORB_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const cx = width / 2 + map(S.dynamicRange, 0, 100, -150, 150);\n const cy = height / 2 + map(S.rhythmicity, 0, 100, -100, 100);\n const baseRadius = map(S.length, 0, 100, 240, 1200);\n const steps = Math.round(map(S.rhythmicity, 0, 100, 280, 400));\n const baseHue = map(S.hue, 0, 100, 0, 360);\n const hue1 = baseHue;\n const hue2 = (baseHue + map(S.attack, 0, 100, 80, 180)) % 360;\n\n noStroke();\n\n for (let i = steps; i > 0; i--) {\n const pct = i / steps;\n const r = baseRadius * pct * map(S.aggression, 0, 100, 0.92, 1.06);\n const t = pow(pct, map(S.brightness, 0, 100, 1.8, 2.8));\n const h = (lerp(hue1, hue2, t) + pct * map(S.harmonicity, 0, 100, -15, 15) + sin(pct * PI * 3) * map(S.brightness, 0, 100, -12, 12)) % 360;\n const sat = constrain(70 + map(S.treble, 0, 100, -20, 20), 0, 100);\n const bri = constrain(lerp(90, 30, t) + map(S.brightness, 0, 100, -6, 4), 0, 100);\n const alpha = (map(pct, 1, 0, 18, 70) + sin(i * 0.15) * map(S.treble, 0, 100, 1, 4)) * map(S.volume, 0, 100, 0.8, 1.1) * 1.2;\n \n fill(hslColor(h, sat, bri, constrain(alpha / 100, 0, 1)));\n \n const rx = r * map(S.aggression, 0, 100, 0.9, 1.05);\n const ry = r * map(S.aggression, 0, 100, 0.9, 1.05);\n const angle = pct * PI * map(S.rhythmicity, 0, 100, 2, 4);\n const wobbleAmp = map(S.aggression, 0, 100, 10, 40);\n const wobbleX = sin(angle) * wobbleAmp;\n const wobbleY = cos(angle) * wobbleAmp;\n \n ellipse(cx + wobbleX, cy + wobbleY, rx * 2, ry * 2);\n }\n}\n\nfunction hslColor(h, s, l, a) {\n if (a !== undefined) return 'hsla(' + h + ',' + s + '%,' + l + '%,' + a + ')';\n return 'hsl(' + h + ',' + s + '%,' + l + '%)';\n}\n";
2
+ export default ORB_SKETCH;
3
+ //# sourceMappingURL=orb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orb.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/orb.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,4kEAgDtB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,50 @@
1
+ export const ORB_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const cx = width / 2 + map(S.dynamicRange, 0, 100, -150, 150);
14
+ const cy = height / 2 + map(S.rhythmicity, 0, 100, -100, 100);
15
+ const baseRadius = map(S.length, 0, 100, 240, 1200);
16
+ const steps = Math.round(map(S.rhythmicity, 0, 100, 280, 400));
17
+ const baseHue = map(S.hue, 0, 100, 0, 360);
18
+ const hue1 = baseHue;
19
+ const hue2 = (baseHue + map(S.attack, 0, 100, 80, 180)) % 360;
20
+
21
+ noStroke();
22
+
23
+ for (let i = steps; i > 0; i--) {
24
+ const pct = i / steps;
25
+ const r = baseRadius * pct * map(S.aggression, 0, 100, 0.92, 1.06);
26
+ const t = pow(pct, map(S.brightness, 0, 100, 1.8, 2.8));
27
+ const h = (lerp(hue1, hue2, t) + pct * map(S.harmonicity, 0, 100, -15, 15) + sin(pct * PI * 3) * map(S.brightness, 0, 100, -12, 12)) % 360;
28
+ const sat = constrain(70 + map(S.treble, 0, 100, -20, 20), 0, 100);
29
+ const bri = constrain(lerp(90, 30, t) + map(S.brightness, 0, 100, -6, 4), 0, 100);
30
+ const alpha = (map(pct, 1, 0, 18, 70) + sin(i * 0.15) * map(S.treble, 0, 100, 1, 4)) * map(S.volume, 0, 100, 0.8, 1.1) * 1.2;
31
+
32
+ fill(hslColor(h, sat, bri, constrain(alpha / 100, 0, 1)));
33
+
34
+ const rx = r * map(S.aggression, 0, 100, 0.9, 1.05);
35
+ const ry = r * map(S.aggression, 0, 100, 0.9, 1.05);
36
+ const angle = pct * PI * map(S.rhythmicity, 0, 100, 2, 4);
37
+ const wobbleAmp = map(S.aggression, 0, 100, 10, 40);
38
+ const wobbleX = sin(angle) * wobbleAmp;
39
+ const wobbleY = cos(angle) * wobbleAmp;
40
+
41
+ ellipse(cx + wobbleX, cy + wobbleY, rx * 2, ry * 2);
42
+ }
43
+ }
44
+
45
+ function hslColor(h, s, l, a) {
46
+ if (a !== undefined) return 'hsla(' + h + ',' + s + '%,' + l + '%,' + a + ')';
47
+ return 'hsl(' + h + ',' + s + '%,' + l + '%)';
48
+ }
49
+ `;
50
+ export default ORB_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const PIXEL_GLYPHS_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const cols = Math.floor(map(S.length, 0, 100, 2, 18));\n const rows = Math.floor(map(S.length, 0, 100, 3, 24));\n const density = map(S.volume, 0, 100, 0.25, 0.6);\n const jitter = map(S.attack, 0, 100, 0, 0.25);\n const sparkRate = map(S.treble, 0, 100, 0.05, 0.45);\n const invertRate = map(S.dynamicRange, 0, 100, 0.05, 0.35);\n\n const margin = 140, gutter = 20, glyphRes = 7;\n const P = [[11,16,38],[255,51,102],[0,224,255],[255,209,102],[124,255,178],[138,43,226]];\n const cellW = (width - margin*2 - gutter*(cols - 1)) / cols;\n const cellH = (height - margin*2 - gutter*(rows - 1)) / rows;\n if (cellW <= 0 || cellH <= 0) return;\n\n noStroke();\n\n for (let gy = 0; gy < rows; gy++) {\n for (let gx = 0; gx < cols; gx++) {\n const cx = margin + gx * (cellW + gutter);\n const cy = margin + gy * (cellH + gutter);\n const invert = noise(gx * 0.4, gy * 0.3) < invertRate;\n const baseA = map(S.amplitude, 0, 100, 0.8, 1.0);\n const rndVal = noise(gx * 0.5, gy * 0.7);\n const baseIdx = 1 + Math.floor(rndVal * 5);\n const accentIdx = 1 + Math.floor(noise(gx + 3.3, gy + 4.4) * 5);\n const baseCol = invert ? [240, 245, 255] : P[baseIdx];\n const accCol = invert ? P[baseIdx] : P[accentIdx];\n\n const px = Math.floor((cellW * 0.84) / glyphRes);\n const py = Math.floor((cellH * 0.84) / glyphRes);\n const gw = px * glyphRes, gh = py * glyphRes;\n const ox = cx + Math.floor((cellW - gw) * 0.5);\n const oy = cy + Math.floor((cellH - gh) * 0.5);\n\n for (let j = 0; j < glyphRes; j++) {\n for (let i = 0; i < Math.ceil(glyphRes / 2); i++) {\n const pNoise = noise(gx * 0.51 + i * 0.19, gy * 0.47 + j * 0.21);\n const p = density + (pNoise - 0.5) * 0.35;\n if (random() < constrain(p, 0.05, 0.9)) {\n const jx = Math.floor((random() - 0.5) * jitter * px);\n const jy = Math.floor((random() - 0.5) * jitter * py);\n const x0 = ox + i * px + jx;\n const y0 = oy + j * py + jy;\n \n fill(baseCol[0], baseCol[1], baseCol[2], baseA * 255);\n rect(x0, y0, px, py);\n const mi = glyphRes - 1 - i;\n rect(ox + mi * px - jx, y0, px, py);\n \n if (random() < sparkRate) {\n fill(accCol[0], accCol[1], accCol[2], baseA * 255);\n rect(x0 + px * 0.2, y0 + py * 0.2, px * 0.6, py * 0.6);\n }\n }\n }\n }\n }\n }\n}\n";
2
+ export default PIXEL_GLYPHS_SKETCH;
3
+ //# sourceMappingURL=pixelGlyphs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixelGlyphs.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/pixelGlyphs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,m4FAsE/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,72 @@
1
+ export const PIXEL_GLYPHS_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const cols = Math.floor(map(S.length, 0, 100, 2, 18));
14
+ const rows = Math.floor(map(S.length, 0, 100, 3, 24));
15
+ const density = map(S.volume, 0, 100, 0.25, 0.6);
16
+ const jitter = map(S.attack, 0, 100, 0, 0.25);
17
+ const sparkRate = map(S.treble, 0, 100, 0.05, 0.45);
18
+ const invertRate = map(S.dynamicRange, 0, 100, 0.05, 0.35);
19
+
20
+ const margin = 140, gutter = 20, glyphRes = 7;
21
+ const P = [[11,16,38],[255,51,102],[0,224,255],[255,209,102],[124,255,178],[138,43,226]];
22
+ const cellW = (width - margin*2 - gutter*(cols - 1)) / cols;
23
+ const cellH = (height - margin*2 - gutter*(rows - 1)) / rows;
24
+ if (cellW <= 0 || cellH <= 0) return;
25
+
26
+ noStroke();
27
+
28
+ for (let gy = 0; gy < rows; gy++) {
29
+ for (let gx = 0; gx < cols; gx++) {
30
+ const cx = margin + gx * (cellW + gutter);
31
+ const cy = margin + gy * (cellH + gutter);
32
+ const invert = noise(gx * 0.4, gy * 0.3) < invertRate;
33
+ const baseA = map(S.amplitude, 0, 100, 0.8, 1.0);
34
+ const rndVal = noise(gx * 0.5, gy * 0.7);
35
+ const baseIdx = 1 + Math.floor(rndVal * 5);
36
+ const accentIdx = 1 + Math.floor(noise(gx + 3.3, gy + 4.4) * 5);
37
+ const baseCol = invert ? [240, 245, 255] : P[baseIdx];
38
+ const accCol = invert ? P[baseIdx] : P[accentIdx];
39
+
40
+ const px = Math.floor((cellW * 0.84) / glyphRes);
41
+ const py = Math.floor((cellH * 0.84) / glyphRes);
42
+ const gw = px * glyphRes, gh = py * glyphRes;
43
+ const ox = cx + Math.floor((cellW - gw) * 0.5);
44
+ const oy = cy + Math.floor((cellH - gh) * 0.5);
45
+
46
+ for (let j = 0; j < glyphRes; j++) {
47
+ for (let i = 0; i < Math.ceil(glyphRes / 2); i++) {
48
+ const pNoise = noise(gx * 0.51 + i * 0.19, gy * 0.47 + j * 0.21);
49
+ const p = density + (pNoise - 0.5) * 0.35;
50
+ if (random() < constrain(p, 0.05, 0.9)) {
51
+ const jx = Math.floor((random() - 0.5) * jitter * px);
52
+ const jy = Math.floor((random() - 0.5) * jitter * py);
53
+ const x0 = ox + i * px + jx;
54
+ const y0 = oy + j * py + jy;
55
+
56
+ fill(baseCol[0], baseCol[1], baseCol[2], baseA * 255);
57
+ rect(x0, y0, px, py);
58
+ const mi = glyphRes - 1 - i;
59
+ rect(ox + mi * px - jx, y0, px, py);
60
+
61
+ if (random() < sparkRate) {
62
+ fill(accCol[0], accCol[1], accCol[2], baseA * 255);
63
+ rect(x0 + px * 0.2, y0 + py * 0.2, px * 0.6, py * 0.6);
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ `;
72
+ export default PIXEL_GLYPHS_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const PRISM_FLOW_FIELDS_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const particleCount = Math.floor(map(S.volume, 0, 100, 1500, 8200));\n const maxSteps = Math.floor(map(S.rhythmicity, 0, 100, 200, 680));\n const weightMin = map(S.volume, 0, 100, 0.5, 1.8);\n const weightMax = map(S.treble, 0, 100, 1.2, 3.2);\n const angleMult = map(max(0, S.harmonicity - 5), 0, 95, 2.5, 7.0);\n const stepJitter = map(S.aggression, 0, 100, 0.5, 2.5);\n const skewOffset = map(S.hue, 0, 100, -PI / 6, PI / 6);\n const alphaBase = map(S.brightness, 0, 100, 0.4, 0.7);\n const scaleF = map(S.harmonicity, 0, 100, 0.0001, 0.0024);\n\n noFill();\n\n for (let i = 0; i < particleCount; i++) {\n let x = random() * width;\n let y = random() * height;\n const hueShift = (i / particleCount) * 360 + (S.hue * 3.6);\n const h = hueShift % 360;\n const sat = map(S.aggression, 0, 100, 70, 100);\n const bri = map(S.brightness, 0, 100, 60, 100);\n \n stroke('hsla(' + h + ',' + sat + '%,' + bri + '%,' + alphaBase + ')');\n strokeWeight(map(random(), 0, 1, weightMin, weightMax));\n \n beginShape();\n vertex(x, y);\n for (let j = 0; j < maxSteps; j++) {\n const angle = noise(x * scaleF, y * scaleF) * PI * 4 + skewOffset;\n const dx = cos(angle) * (angleMult + (random() - 0.5) * stepJitter);\n const dy = sin(angle) * (angleMult + (random() - 0.5) * stepJitter);\n x += dx;\n y += dy;\n if (x < 0 || x > width || y < 0 || y > height) break;\n vertex(x, y);\n }\n endShape();\n }\n}\n";
2
+ export default PRISM_FLOW_FIELDS_SKETCH;
3
+ //# sourceMappingURL=prismFlowFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prismFlowFields.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/prismFlowFields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,43DAiDpC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,51 @@
1
+ export const PRISM_FLOW_FIELDS_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const particleCount = Math.floor(map(S.volume, 0, 100, 1500, 8200));
14
+ const maxSteps = Math.floor(map(S.rhythmicity, 0, 100, 200, 680));
15
+ const weightMin = map(S.volume, 0, 100, 0.5, 1.8);
16
+ const weightMax = map(S.treble, 0, 100, 1.2, 3.2);
17
+ const angleMult = map(max(0, S.harmonicity - 5), 0, 95, 2.5, 7.0);
18
+ const stepJitter = map(S.aggression, 0, 100, 0.5, 2.5);
19
+ const skewOffset = map(S.hue, 0, 100, -PI / 6, PI / 6);
20
+ const alphaBase = map(S.brightness, 0, 100, 0.4, 0.7);
21
+ const scaleF = map(S.harmonicity, 0, 100, 0.0001, 0.0024);
22
+
23
+ noFill();
24
+
25
+ for (let i = 0; i < particleCount; i++) {
26
+ let x = random() * width;
27
+ let y = random() * height;
28
+ const hueShift = (i / particleCount) * 360 + (S.hue * 3.6);
29
+ const h = hueShift % 360;
30
+ const sat = map(S.aggression, 0, 100, 70, 100);
31
+ const bri = map(S.brightness, 0, 100, 60, 100);
32
+
33
+ stroke('hsla(' + h + ',' + sat + '%,' + bri + '%,' + alphaBase + ')');
34
+ strokeWeight(map(random(), 0, 1, weightMin, weightMax));
35
+
36
+ beginShape();
37
+ vertex(x, y);
38
+ for (let j = 0; j < maxSteps; j++) {
39
+ const angle = noise(x * scaleF, y * scaleF) * PI * 4 + skewOffset;
40
+ const dx = cos(angle) * (angleMult + (random() - 0.5) * stepJitter);
41
+ const dy = sin(angle) * (angleMult + (random() - 0.5) * stepJitter);
42
+ x += dx;
43
+ y += dy;
44
+ if (x < 0 || x > width || y < 0 || y > height) break;
45
+ vertex(x, y);
46
+ }
47
+ endShape();
48
+ }
49
+ }
50
+ `;
51
+ export default PRISM_FLOW_FIELDS_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const RADIAL_BURST_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const centerX = width / 2;\n const centerY = height / 2;\n const baseN = Math.floor(map(S.rhythmicity, 0, 100, 90, 320));\n const rhythmMask = 0.4 + (S.rhythmicity / 100) * 0.6;\n\n const palette = [];\n const mainHue = (S.brightness * 3.6) % 360;\n for (let i = 0; i < 16; i++) {\n const h = (mainHue + i * 22.5) % 360;\n const sat = map(S.treble, 0, 100, 60, 90);\n const bri = map(S.bass, 0, 100, 70, 95);\n palette.push('hsl(' + h + ',' + sat + '%,' + bri + '%)');\n }\n\n noFill();\n\n for (let i = 0; i < baseN; i++) {\n if ((i % 3) && random() > rhythmMask) continue;\n\n const angle = (i / baseN) * PI * 2;\n const col = palette[i % palette.length];\n\n const lenJit = map(S.dynamicRange, 0, 100, 0, height * 2.45);\n const rayLength = (S.amplitude / 100) * (height * 1.65) + random() * lenJit;\n\n const waveAmp = map(S.harmonicity, 0, 100, 0, 42);\n const waveFreq = map(S.treble, 0, 100, 1, 48);\n const segments = 28;\n\n const thickness = 1.2 + (S.attack / 100) * 7 + (S.aggression / 100) * 5 + sin(i * 0.9) * 1.4;\n\n stroke(col);\n strokeWeight(thickness);\n\n beginShape();\n for (let s = 0; s <= segments; s++) {\n const t = s / segments;\n const radius = t * rayLength;\n const wobble = sin(t * PI * waveFreq + i * 0.2) * waveAmp * (1 - t);\n const wx = centerX + cos(angle + wobble * 0.01) * radius;\n const wy = centerY + sin(angle + wobble * 0.01) * radius;\n vertex(wx, wy);\n }\n endShape();\n }\n}\n";
2
+ export default RADIAL_BURST_SKETCH;
3
+ //# sourceMappingURL=radialBurst.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radialBurst.d.ts","sourceRoot":"","sources":["../../../../soundart-sketches/radialBurst.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+5DA0D/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}