Exemplo n.º 1
0
        public DelayLine(int bufferSize, int samplerate)
        {
            delay = new ModulatedDelay(bufferSize, 10000);
            diffuser = new AllpassDiffuser(bufferSize, samplerate) { ModulationEnabled = false };
            tempBuffer = new double[bufferSize];
            filterOutputBuffer = new double[bufferSize];

            lowPass = new Lp1(samplerate);
            lowShelf = new Biquad(Biquad.FilterType.LowShelf, samplerate) { Slope = 1.0, GainDB = -20, Frequency = 20 };
            highShelf = new Biquad(Biquad.FilterType.HighShelf, samplerate) { Slope = 1.0, GainDB = -20, Frequency = 19000 };
            lowPass.CutoffHz = 1000;
            lowShelf.Update();
            highShelf.Update();
            Samplerate = samplerate;
        }
Exemplo n.º 2
0
        public ReverbChannel(int bufferSize, int samplerate)
        {
            parameters = new Dictionary<Parameter, double>();
            foreach (var value in Enum.GetValues(typeof(Parameter)).Cast<Parameter>())
                parameters[value] = 0.0;

            preDelay = new ModulatedDelay(bufferSize, 10000);

            multitap = new MultitapDiffuser(bufferSize);
            diffuser = new AllpassDiffuser(bufferSize, samplerate) { ModulationEnabled = true };
            lines = Enumerable.Range(0, 12).Select(x => new DelayLine(bufferSize, samplerate)).ToArray();
            lineCount = 8;
            perLineGain = GetPerLineGain();

            highPass = new Hp1(samplerate) { CutoffHz = 20 };
            lowPass = new Lp1(samplerate) { CutoffHz = 20000 };

            rand = new ShaRandom();
            tempBuffer = new double[bufferSize];
            outBuffer = new double[bufferSize];
            delayLineSeeds = rand.Generate(12345, lines.Length * 3).ToArray();

            this.samplerate = samplerate;
        }