start method

void start({
  1. required ArrayInt16 data,
  2. required LoopMode loopMode,
  3. required int sampleRate,
  4. required int start,
  5. required int end,
  6. required int startLoop,
  7. required int endLoop,
  8. required int rootKey,
  9. required int coarseTune,
  10. required int fineTune,
  11. required int scaleTuning,
})

Implementation

void start({required ArrayInt16 data,
            required LoopMode loopMode,
            required int sampleRate,
            required int start,
            required int end,
            required int startLoop,
            required int endLoop,
            required int rootKey,
            required int coarseTune,
            required int fineTune,
            required int scaleTuning})
{
  _data = data;
  _loopMode = loopMode;
  _end = end;
  _startLoop = startLoop;
  _endLoop = endLoop;
  _rootKey = rootKey;

  _tune = coarseTune + 0.01 * fineTune;
  _pitchChangeScale = 0.01 * scaleTuning;
  _sampleRateRatio = sampleRate / synthesizer.sampleRate;

  if (loopMode == LoopMode.noLoop)
  {
      _looping = false;
  }
  else
  {
      _looping = true;
  }

  _position = start.toDouble();
}