示例#1
0
        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);
        }
示例#2
0
        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);
        }