public WavetableCalculator(IWaveformCalculator calculator) { int wavetableSize = 1024; List<float> wavetableSamples = new List<float>(); for (int position = 0; position < wavetableSize; position++) { float sample = calculator.CalculateForSample(position, wavetableSize, wavetableSize*wavetableSize); wavetableSamples.Add(sample); } wavetable = new Wavetable(wavetableSamples); }
public WavetableCalculator(IWaveformCalculator calculator) { int wavetableSize = 1024; List <float> wavetableSamples = new List <float>(); for (int position = 0; position < wavetableSize; position++) { float sample = calculator.CalculateForSample(position, wavetableSize, wavetableSize * wavetableSize); wavetableSamples.Add(sample); } wavetable = new Wavetable(wavetableSamples); }