Skip to content

Weather scenes, immersive view, and a transport clock fix - #6

Merged
HalcyonVector merged 3 commits into
mainfrom
feature/weather-scenes-immersive
Oct 31, 2026
Merged

HalcyonVector merged 3 commits into
mainfrom
feature/weather-scenes-immersive

Conversation

@HalcyonVector

@HalcyonVector HalcyonVector commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Weather scenes

  • Aurora on dark, clear, dry nights: tilted green, blue and violet curtains of light with vertical rays, slowly swaying. Fades with cloud, daylight and any precipitation.
  • Fog banks rolling along the hills on a WMO fog code, or as a light haze once cloud cover passes 75%.
  • Rain ripples spreading on the ground (more in heavier rain) and a soft, broken reflection of the sun or moon on the wet ground.
  • Amounts come from pure, tested functions (sky/sceneMath.ts). Simulate mode has a new "Fog" weather type to preview it.

Immersive view

  • New expand button in the tray: the tray fades away, leaving the sky, the current chord and key in large type, and the place, weather and time beneath.
  • A wide aurora-like band of light along the horizon, whose ribbons rise and sway with the music's loudness and waveform.
  • The cursor and exit hint fade after a few idle seconds. Click anywhere or press Esc to return; Space still plays/stops. Focus is handled for keyboard users.
  • On phones, the Rec button is icon-only so the volume slider keeps its room.

Bug fix: transport clock errors

Every parameter update re-applied the tempo with an exponential ramp, even when it hadn't changed. Tone's tick maths over an exponential ramp between two equal values is 0/0, so the clock computed NaN/-Infinity tick times and threw "Cannot read properties of undefined (reading 'time')" right after starting playback, almost always in Simulate mode. The tempo now only ramps when it actually changes, and linearly.

Testing

  • 13 server and 133 client tests pass, typecheck clean, production build succeeds.
  • Checked in a browser: all three weather scenes, immersive view on desktop and phone (enter, Space, idle hide, Esc and click to exit, focus return), and zero errors across repeated start/simulate runs. Tempo still ramps to the expected values.
  • Everything respects prefers-reduced-motion.

- Aurora on dark, clear, dry nights: three tilted curtains of green, blue
  and violet light with vertical rays, slowly swaying; fades with cloud,
  daylight and any precipitation.
- Fog banks rolling along the hills on a WMO fog code, or as a light haze
  once cloud cover passes 75%.
- Rain ripples spreading on the ground (more with heavier rain) and a
  soft, broken reflection of the sun or moon on the wet ground.
- Pure, tested amounts in sky/sceneMath.ts; isFoggy() for WMO 45/48;
  "Fog" added to the Simulate weather types. Animations stop under
  prefers-reduced-motion.
Every parameter update called bpm.rampTo(tempo), even with the tempo
unchanged. Tone ramps BPM exponentially, and its tick integration over an
exponential ramp between two equal values is 0/0, so the transport clock
computed NaN/-Infinity tick times and threw "Cannot read properties of
undefined (reading 'time')" from TickSource.getTicksAtTime. Seen right
after starting playback, almost always in Simulate mode where the hour
(and so the tempo) doesn't move.

Now the tempo only ramps when it actually changes (> 0.05 BPM), and
linearly. Verified: no errors across repeated start/simulate runs, and
tempo still ramps to the expected values (56 BPM at 3am, 95.3 at 2pm).
- New expand button in the tray: the tray and wordmark fade away, leaving
  the sky, the current chord and key in large type, and the place,
  weather and time beneath.
- HorizonBand: a wide band of light along the horizon whose three
  additive ribbons rise and sway with the music's loudness and waveform
  (not rendered under prefers-reduced-motion).
- Cursor and exit hint fade after 3 idle seconds. Click anywhere or press
  Escape to return; focus moves into the view on entry and back to its
  button on exit, and the hidden tray can't be tabbed to. Space still
  plays/stops.
- Phones: the Rec button goes icon-only so the volume slider keeps room.
- README updated for weather scenes and the immersive view.
@HalcyonVector
HalcyonVector merged commit 5f093b6 into main Oct 31, 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