コード例 #1
0
        public ReverbState(ref ReverbParameter parameter, ulong workBuffer, bool isLongSizePreDelaySupported)
        {
            FdnDelayLines  = new DelayLine[4];
            DecayDelays    = new DecayDelay[4];
            EarlyDelayTime = new uint[EarlyModeCount];
            EarlyGain      = new float[EarlyModeCount];
            HighFrequencyDecayDirectGain   = new float[4];
            HighFrequencyDecayPreviousGain = new float[4];
            PreviousFeedbackOutput         = new float[4];

            ReadOnlySpan <float> fdnDelayTimes   = GetFdnDelayTimesByLateMode(ReverbLateMode.Limit);
            ReadOnlySpan <float> decayDelayTimes = GetDecayDelayTimesByLateMode(ReverbLateMode.Limit);

            uint sampleRate = (uint)FixedPointHelper.ToFloat((uint)parameter.SampleRate, FixedPointPrecision);

            for (int i = 0; i < 4; i++)
            {
                FdnDelayLines[i] = new DelayLine(sampleRate, fdnDelayTimes[i]);
                DecayDelays[i]   = new DecayDelay(new DelayLine(sampleRate, decayDelayTimes[i]));
            }

            float preDelayTimeMax = 150.0f;

            if (isLongSizePreDelaySupported)
            {
                preDelayTimeMax = 350.0f;
            }

            PreDelayLine         = new DelayLine(sampleRate, preDelayTimeMax);
            FrontCenterDelayLine = new DelayLine(sampleRate, 5.0f);

            UpdateParameter(ref parameter);
        }
コード例 #2
0
ファイル: Reverb3dState.cs プロジェクト: Xpl0itR/Ryujinx
        public Reverb3dState(ref Reverb3dParameter parameter, ulong workBuffer)
        {
            FdnDelayLines                 = new IDelayLine[4];
            DecayDelays1                  = new DecayDelay[4];
            DecayDelays2                  = new DecayDelay[4];
            DecayDirectFdnGain            = new float[4];
            DecayCurrentFdnGain           = new float[4];
            DecayCurrentOutputGain        = new float[4];
            PreviousFeedbackOutputDecayed = new float[4];

            uint sampleRate = parameter.SampleRate / 1000;

            for (int i = 0; i < 4; i++)
            {
                FdnDelayLines[i] = new DelayLine3d(sampleRate, FdnDelayMaxTimes[i]);
                DecayDelays1[i]  = new DecayDelay(new DelayLine3d(sampleRate, DecayDelayMaxTimes1[i]));
                DecayDelays2[i]  = new DecayDelay(new DelayLine3d(sampleRate, DecayDelayMaxTimes2[i]));
            }

            PreDelayLine         = new DelayLine3d(sampleRate, 400);
            FrontCenterDelayLine = new DelayLine3d(sampleRate, 5);

            UpdateParameter(ref parameter);
        }