Skip to content

Melody, nature sounds, moon phase, seasons and low-power mode - #8

Merged
HalcyonVector merged 7 commits into
mainfrom
feature/melody-moon-seasons
Nov 1, 2026
Merged

HalcyonVector merged 7 commits into
mainfrom
feature/melody-moon-seasons

Conversation

@HalcyonVector

@HalcyonVector HalcyonVector commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Music

  • Melody: now and then a short phrase is sung over the chord on a soft voice with vibrato and an echo. Phrases (3 to 6 notes) rise then fall, start and end on chord tones and never repeat a note back to back. More often when you're active or in the daytime, half as often in focus mode. New "Melody" mixer channel.
  • Nature sounds: wind gusts that follow the wind speed, crickets on warm dry nights, birdsong around dawn (a little at dusk), and a high bell-like shimmer while it snows. New "Nature" mixer channel.
  • Sunrise/sunset swell: a slow, wide chord when the sun crosses the horizon while playing.
  • Seasons: winter is a few BPM slower, darker and more reverberant; summer quicker and livelier. Uses the location's latitude, so the southern hemisphere is flipped.

Sky

  • Real moon phase: the moon is drawn at tonight's actual phase over a faint earthshine disc; on clear nights a full moon brightens the sound a touch and a new moon darkens it.
  • Seasonal tint: faintly cooler in winter, warmer in summer.
  • The Studio readout shows the season, the moon phase and which nature sounds are active.

Fixes and settings

  • Drizzle: very light rain now says DRIZZLE instead of OVERCAST, matching the rain the sky already draws.
  • Low-power visuals (Studio → Sound, Auto/On/Off): solid panels instead of blur, a calmer sky, no music reactions and a lighter waveform, for older phones and battery. Auto turns on with the data saver or on modest hardware. The music is unchanged.

Older presets, share links and saved mixer levels keep working.

Testing

  • 13 server and 162 client tests pass, typecheck clean, production build succeeds. New pure modules are unit-tested: melody, moon, seasons, low-power detection, nature mapping, drizzle.
  • Checked in a browser: melody phrases play (no stuck notes); the moon renders correctly at four real dates; crickets, birds, snow bells, wind gusts and the sunrise swell each fire only in their conditions; output peak stays below the limiter; low-power mode applies, persists, and stops the sky reactions. No errors.

The sky starts drawing raindrops and ground ripples at 0.05 mm/h, but the
label only switched from the cloud description to LIGHT RAIN at 0.1 mm/h,
so drizzle showed rain in the sky while the card said OVERCAST.
- New lead voice: a soft triangle tone that swells in, with light vibrato,
  a low-pass, and a dotted-eighth echo into the reverb.
- Phrases come from a pure, tested generator (audio/melody.ts): 3 to 6
  notes over one chord that rise then fall, mostly by step with the odd
  leap, starting and ending on chord tones, never repeating a note back to
  back, and leaving space at the end of the two bars.
- A phrase is sung on some chord changes: more often when the arp is busy
  (you're active, or it's daytime), half as often in focus mode. Pitched
  around middle C in the current key, whatever octave the mix is in.
  Melody notes also make the stars flare.
- New "Melody" mixer channel (saved mixes without it keep their levels).
- lib/moon.ts (tested against known 2024 new and full moons): phase from
  the mean synodic month, illumination, phase names, and an SVG path for
  the lit part (lit limb plus a terminator ellipse that follows the phase;
  waxing lit on the right, waning on the left).
- The moon is drawn lit by that amount over a faint earthshine disc, and
  its glow scales with how much of it is lit.
- On clear nights a full moon lifts the brightness a touch and a new moon
  darkens it; cloud and daylight remove the effect.
- Studio readout shows the phase, e.g. "Waxing gibbous · 78% lit".
- audio/NatureVoices.ts, all synthesized: wind gusts (filtered noise that
  swells and sweeps, plus a light bed of air when it's windy), crickets
  (high chirps in threes, panned), birdsong (calls of 2 to 5 pitch-swept
  tweets), and snow shimmer (sparse high bell tones from the current
  chord, into the reverb).
- Mapping (tested): crickets on warm, dry nights; birds around dawn and a
  few at dusk, fewer in rain and none in hard frost; shimmer while it
  snows; gusts follow wind speed. New optional params so older presets and
  share links still load.
- A slow, wide chord swells when the sun rises (home chord) or sets
  (current chord) while playing, including when Simulate's hour is
  dragged across the horizon.
- New "Nature" mixer channel; the Studio readout lists what's active.
…lier

- lib/seasons.ts (tested): a smooth "winterness" curve (1 midwinter, 0
  midsummer), flipped for the southern hemisphere and fading toward
  neutral near the equator, plus season names.
- The weather location's latitude is now passed through to the client so
  the hemisphere is right; unknown latitude assumes northern.
- Mapping: winter is a few BPM slower, a little darker, more reverberant
  and slightly sparser; summer the opposite. Neutral at the equinoxes.
- The sky gets a faint cool tint in winter and a warm one in summer, and
  the Studio readout shows the season.
- Studio → Sound → Low-power visuals. Auto turns it on when the browser's
  data saver is on, on very weak hardware (2 cores or 2 GB or less), or on
  modest hardware on both counts (4 cores and 4 GB or less); a 4-core
  laptop with plenty of memory keeps the full visuals. Remembered.
- When on: solid panels instead of backdrop blur, no drifting particles
  or ripples, the sky's twinkle/aurora/fog/reflection animations stop, the
  sky no longer reacts to the music, the immersive aurora band is skipped,
  and the waveform draws at about 20 fps without glow. Audio is untouched.
- Detection and persistence are pure functions with tests.
@HalcyonVector
HalcyonVector merged commit f6565d0 into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant