Esempio n. 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);
        }
Esempio n. 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);
        }