import { defaultGardenAudioVibeSettings, type GardenAudioChord, } from '../audio/garden-audio-config'; import { VibeId, type GardenVibeSettings, type VibePreset } from './types'; type ColorReactionSettings = Pick< GardenVibeSettings, | 'color1ToColor1' | 'color1ToColor2' | 'color1ToColor3' | 'color2ToColor1' | 'color2ToColor2' | 'color2ToColor3' | 'color3ToColor1' | 'color3ToColor2' | 'color3ToColor3' >; const colorReactions = { auroraMycelium: { color1ToColor1: 1, color1ToColor2: 0, color1ToColor3: 0, color2ToColor1: -1, color2ToColor2: 1, color2ToColor3: 0, color3ToColor1: -1, color3ToColor2: -1, color3ToColor3: 1, }, velvetObservatory: { color1ToColor1: 1, color1ToColor2: -1, color1ToColor3: -1, color2ToColor1: -1, color2ToColor2: 1, color2ToColor3: -1, color3ToColor1: -1, color3ToColor2: -1, color3ToColor3: 1, }, lichenSignal: { color1ToColor1: 0, color1ToColor2: -1, color1ToColor3: 1, color2ToColor1: -1, color2ToColor2: 0, color2ToColor3: -1, color3ToColor1: 1, color3ToColor2: -1, color3ToColor3: 1, }, tidepoolLantern: { color1ToColor1: 0, color1ToColor2: 1, color1ToColor3: 0, color2ToColor1: 0, color2ToColor2: 0, color2ToColor3: 1, color3ToColor1: 1, color3ToColor2: 0, color3ToColor3: 0, }, paperLanternFog: { color1ToColor1: 1, color1ToColor2: 1, color1ToColor3: 1, color2ToColor1: 1, color2ToColor2: 1, color2ToColor3: 1, color3ToColor1: 1, color3ToColor2: 1, color3ToColor3: 1, }, chromePollen: { color1ToColor1: 1, color1ToColor2: 0, color1ToColor3: 1, color2ToColor1: -1, color2ToColor2: 1, color2ToColor3: 0, color3ToColor1: 1, color3ToColor2: 0, color3ToColor3: 1, }, } satisfies Record; const musicScales = { dorian: [0, 2, 3, 5, 7, 9, 10], lydian: [0, 2, 4, 6, 7, 9, 11], mixolydian: [0, 2, 4, 5, 7, 9, 10], naturalMinor: [0, 2, 3, 5, 7, 8, 10], } satisfies Record>; const musicProgressions = { aurora: [ { rootOffset: 0, quality: 'sus2' }, { rootOffset: 7, quality: 'major' }, { rootOffset: 9, quality: 'minor' }, { rootOffset: 5, quality: 'sus4' }, ], chrome: [ { rootOffset: 0, quality: 'major' }, { rootOffset: 2, quality: 'major' }, { rootOffset: 7, quality: 'sus2' }, { rootOffset: 9, quality: 'minor' }, ], lichen: [ { rootOffset: 0, quality: 'minor' }, { rootOffset: 5, quality: 'major' }, { rootOffset: 10, quality: 'major' }, { rootOffset: 3, quality: 'major' }, ], paperLantern: [ { rootOffset: 0, quality: 'minor' }, { rootOffset: 8, quality: 'major' }, { rootOffset: 5, quality: 'minor' }, { rootOffset: 10, quality: 'sus4' }, ], tidepool: [ { rootOffset: 0, quality: 'major' }, { rootOffset: 10, quality: 'major' }, { rootOffset: 5, quality: 'sus2' }, { rootOffset: 9, quality: 'minor' }, ], velvet: [ { rootOffset: 0, quality: 'minor' }, { rootOffset: 8, quality: 'major' }, { rootOffset: 3, quality: 'major' }, { rootOffset: 5, quality: 'sus4' }, ], } satisfies Record>; export const defaultVibeId = VibeId.AuroraMycelium; export const vibePresets: Array = [ { id: VibeId.AuroraMycelium, name: 'Aurora Mycelium Copy', colors: [ [221, 255, 78], [154, 99, 255], [255, 31, 199], ], backgroundColor: [6, 13, 22], settings: { ...colorReactions.auroraMycelium, backgroundGrainStrength: 0.003, brushSize: 8.75, clarity: 0.379, decayRateTrails: 940, forwardRotationScale: 0, individualTrailWeight: 0.121, moveSpeed: 270, sensorOffsetAngle: 36, sensorOffsetDistance: 51, spawnPerPixel: 0.13999999999999999, strokeAngleJitterRadians: 0.44999999999999996, turnSpeed: 22, turnWhenLost: 6.071532165918825e-17, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.12, bpm: 60, rampUpIntensity: 0.7000000000000001, rampUpTime: 0.14, noteLength: 0.86, notePitchOffset: -2, brightness: 0.8400000000000001, scale: musicScales.lydian, progression: musicProgressions.aurora, }, }, { id: VibeId.VelvetObservatory, name: 'Velvet Observatory', colors: [ [178, 76, 62], [2, 174, 255], [213, 193, 9], ], backgroundColor: [7, 4, 22], settings: { ...colorReactions.velvetObservatory, backgroundGrainStrength: 0.005, brushSize: 9.75, clarity: 0.437, decayRateTrails: 915, forwardRotationScale: 2.0816681711721685e-17, individualTrailWeight: 0.1, moveSpeed: 216, sensorOffsetAngle: 24, sensorOffsetDistance: 17, spawnPerPixel: 0.24, strokeAngleJitterRadians: 0.16999999999999993, turnSpeed: 33, turnWhenLost: 0.42000000000000004, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.55, bpm: 72, rampUpIntensity: 1.42, rampUpTime: 0.07000000000000002, noteLength: 0.7000000000000001, notePitchOffset: 0, brightness: 0.94, scale: musicScales.naturalMinor, progression: musicProgressions.velvet, }, }, { id: VibeId.LichenSignal, name: 'Lichen Signal', colors: [ [183, 216, 92], [65, 166, 128], [238, 120, 76], ], backgroundColor: [0, 0, 0], settings: { ...colorReactions.lichenSignal, backgroundGrainStrength: 0.02, brushSize: 6.5, clarity: 0.74, decayRateTrails: 962, forwardRotationScale: 0.3, individualTrailWeight: 0.052000000000000005, moveSpeed: 72, sensorOffsetAngle: 42, sensorOffsetDistance: 54, spawnPerPixel: 0.15999999999999998, strokeAngleJitterRadians: 3.1399999999999997, turnSpeed: 44, turnWhenLost: 0.9200000000000002, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.13, bpm: 68, rampUpIntensity: 1.46, rampUpTime: 0.10000000000000002, noteLength: 0.6, notePitchOffset: -3, brightness: 1.21, scale: musicScales.dorian, progression: musicProgressions.lichen, }, }, { id: VibeId.TidepoolLantern, name: 'Tidepool Lantern', colors: [ [30, 219, 194], [61, 118, 255], [255, 191, 91], ], backgroundColor: [4, 18, 29], settings: { ...colorReactions.tidepoolLantern, backgroundGrainStrength: 0.018, brushSize: 17, clarity: 0.56, decayRateTrails: 968, forwardRotationScale: 0.38, individualTrailWeight: 0.06, moveSpeed: 88, sensorOffsetAngle: 64, sensorOffsetDistance: 46, spawnPerPixel: 0.22, strokeAngleJitterRadians: 1.8, turnSpeed: 66, turnWhenLost: 1.05, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.08, bpm: 84, rampUpIntensity: 0.95, rampUpTime: 0.08, noteLength: 0.46, notePitchOffset: 0, brightness: 0.98, scale: musicScales.mixolydian, progression: musicProgressions.tidepool, }, }, { id: VibeId.PaperLanternFog, name: 'Paper Lantern Fog Copy', colors: [ [255, 176, 108], [239, 90, 108], [128, 213, 184], ], backgroundColor: [30, 23, 20], settings: { ...colorReactions.paperLanternFog, backgroundGrainStrength: 0.038, brushSize: 3.5, clarity: 1, decayRateTrails: 999, forwardRotationScale: 0.24, individualTrailWeight: 0.937, moveSpeed: 28, sensorOffsetAngle: 34, sensorOffsetDistance: 66, spawnPerPixel: 0.05499999999999998, strokeAngleJitterRadians: 0, turnSpeed: 30, turnWhenLost: 1.52, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.33, bpm: 127, rampUpIntensity: 0.66, rampUpTime: 0.03000000000000001, noteLength: 0.92, notePitchOffset: 10, brightness: 1.42, scale: musicScales.naturalMinor, progression: musicProgressions.paperLantern, }, }, { id: VibeId.ChromePollen, name: 'Chrome Pollen', colors: [ [178, 34, 34], [255, 214, 48], [77, 240, 157], ], backgroundColor: [7, 12, 11], settings: { ...colorReactions.chromePollen, backgroundGrainStrength: 0.012, brushSize: 4.5, clarity: 0.1, decayRateTrails: 922, forwardRotationScale: 0.5, individualTrailWeight: 0.026000000000000002, moveSpeed: 86, sensorOffsetAngle: 46, sensorOffsetDistance: 14, spawnPerPixel: 0.36, strokeAngleJitterRadians: 3, turnSpeed: 34, turnWhenLost: 1.35, }, audio: { ...defaultGardenAudioVibeSettings, idleIntensity: 0.11, bpm: 150, rampUpIntensity: 2, rampUpTime: 0.06000000000000001, noteLength: 1.8, notePitchOffset: -12, brightness: 0.5, scale: musicScales.lydian, progression: musicProgressions.chrome, }, }, ];