updateFromAudio method

void updateFromAudio({
  1. required double phase,
  2. required double amplitude,
  3. required double pan,
  4. required double breath,
  5. required double modulation,
  6. required double neuro,
  7. required double frequency,
})

Implementation

void updateFromAudio({
  required double phase,
  required double amplitude,
  required double pan,
  required double breath,
  required double modulation,
  required double neuro,
  required double frequency,
}) {
  AppConfig.logger
      .t('NeomFrequencyPainterEngine.updateFromAudio: '
      'phase=$phase, amplitude=$amplitude, pan=$pan, '
      'breath=$breath, modulation=$modulation, neuro=$neuro');
  _state = NeomVisualState(
    frequency: _normalizeFrequency(frequency),
    phase: _smooth(current: _state.phase, target: phase, factor: 0.2),
    pan: _smooth(current: _state.pan, target: pan, factor: 0.25),
    modulation: _smooth(current: _state.modulation, target: modulation, factor: 0.2),
    amplitude: _smooth(
      current: _state.amplitude,
      target: amplitude,
      factor: smoothAmp,
    ),
    breath: _smooth(
      current: _state.breath,
      target: breath,
      factor: smoothBreath,
    ),
    neuro: _smooth(
      current: _state.neuro,
      target: neuro,
      factor: smoothNeuro,
    ),
  );

  notifyListeners();
}