Offer the easings of an animation key on Lerp and sound FX ramps
game-maker / gate (push) Successful in 3m15s
game-maker / suite (push) Successful in 15m36s

A timed Set sound FX parameters ran only linearly, and a Lerp had four
quadratic eases of its own. An animation key already had the full set.
Now all three offer the same choice: Linear, Step, the ten curves from
Sine to Bounce with In, Out or In-out, and a drawn Curve asset.

- easingParams in src/core/graph/nodes/easing.ts gives a node the
  fields Easing, Direction and Curve from the key's own lists, and
  easingOfParams reads them back as a key interpolation.
- There is no migration. A Lerp saved with the old in, out or inOut
  runs linear until its easing is picked again.
- Set sound FX parameters hands the easing to the player. Linear and
  Step stay ramps of the audio clock, every other easing goes to
  setValueCurveAtTime as 200 samples a second, in semitones and dB.
- Step now reaches its end at t 1. A key never asked for that, it
  reads the next key itself, so animations play as before.
- The curve-in-use count and the warning for a gone curve cover the
  sound node too.

Tests:
- node-catalog: Lerp with cubic in, quad out and in-out, a curve
  without a direction, step, an unknown easing as linear. The sound
  node hands on a curve, step and a gone curve as linear.
- sound-library: an eased change becomes a curve in semitones and
  decibels, a step a jump at the end.
- node-catalog and curve after dropping the old values: 399, green.
- e2e 6, 34, 53 on melektaus-atx: ALL PASSED, 198 checks. In Chrome a
  2 s Quad in from depth 7 to -5 read speed 0.864 early and 0.5 at the
  end, a 1 s Step held 1 and then jumped to 0.5.
- Counter-check: with curves sent as linear ramps, the curve test of
  the sound library fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-05 22:05:00 +02:00
1 parent 501a1524ed
commit e7a360db73
17 files changed
+347 -104

No files matched your search

+4 -2
View File
@@ -1,3 +1,4 @@
import type { EaseShare } from '../../core/model/animation';
import type { FxParams, FxVoice } from '../../core/soundfx/nodes';
/**
@@ -23,9 +24,10 @@ export interface AudioSink {
* A name its FX does not have is left out, one not given keeps its value. A voice that has ended
* is not there any more and nothing happens – a detached one is reached like any other. `time` is
* how many seconds the values take to get there, counted on the audio clock from now – or from
* the moment the voice really starts, where it still waits on its bytes. 0 is a quick glide.
* the moment the voice really starts, where it still waits on its bytes, along `ease` (linear
* where it is not given). 0 is a quick glide.
*/
tune(voice: number, params: FxParams, time?: number): void;
tune(voice: number, params: FxParams, time?: number, ease?: EaseShare): void;
/** Silences every voice of that file; `''` silences all of them. */
stop(file: string): void;
/** Silences every voice started by that owner – what destroying a behavior does. */
+1 -1
View File
@@ -172,7 +172,7 @@ export function behaviorContext(
const file = assetId === '' ? '' : soundFileOf(project, assetId);
if (assetId === '' || file) run.audio.stop(file);
},
tuneSound: (voice, fxParams, time) => run.audio.tune(voice, fxParams, time),
tuneSound: (voice, fxParams, time, ease) => run.audio.tune(voice, fxParams, time, ease),
spawn: (assetId, position, parent) => world.spawn(assetId, position, resolve(parent) ?? null),
addJoint: (assetId, owner, connected, at) => {
const on = resolve(owner);