apply static method

void apply(
  1. HarmonicFootprint? footprint,
  2. NeomSineEngine engine
)

Apply the footprint's resonance to the sine engine.

Sets engine.frequency to footprint.resonanceHz if valid (> 20 Hz and < 2500 Hz, the generator's supported range). Falls back to the default 432 Hz if the footprint has no captures or the resonance is out of range.

Implementation

static void apply(HarmonicFootprint? footprint, NeomSineEngine engine) {
  if (footprint == null || footprint.totalCaptures == 0) return;

  final hz = footprint.resonanceHz;
  if (hz >= 20.0 && hz <= 2500.0) {
    engine.frequency = hz;
  }
}