Пример #1
0
        private void UpdateAll()
        {
            GainTF.SetParam(Gain.P_GAIN, Utils.LogResponse(ParameterInfo[P_GAIN].Value));
            PostGain.SetParam(postGain.P_GAIN, Utils.ExpResponse(ParameterInfo[P_GAIN].Value));

            Tonestack.SetParam(Tonestack.P_BASS, Utils.ExpResponse(ParameterInfo[P_BASS].Value));
            Tonestack.SetParam(Tonestack.P_TREBLE, ParameterInfo[P_TREBLE].Value);
            Tonestack.SetParam(Tonestack.P_MID, 1);

            Contour.SetParam(Contour.P_CONTOUR, Utils.LogResponse(1 - ParameterInfo[P_CONTOUR].Value));

            OutLP.SetParam(0, 1600f + Utils.ExpResponse(ParameterInfo[P_HAIR].Value) * 11000f);

            Hp1.Update();
            LpNoise.Update();
            GainTF.Update();
            PostGain.Update();
            SaturateLP.Update();
            ClipperHP.Update();
            Tonestack.Update();
            TF2.Update();
            Contour.Update();
            OutHP.Update();
            OutLP.Update();
        }
Пример #2
0
        private void UpdateAll()
        {
            HpInput.SetParam(Highpass1.P_FREQ, 15);
            TFStage.Update();
            var lowpassFreq = 1592 + Utils.ExpResponse(ParameterInfo[P_FILTER].Value) * 8000;

            LowpassFilter.SetParam(Lowpass1.P_FREQ, lowpassFreq);
            HpOutput.SetParam(Highpass1.P_FREQ, 30);
        }
Пример #3
0
        private void UpdateAll()
        {
            Hipass1.SetParam(0, 10f + (float)Math.Round(ParameterInfo[P_TIGHT].Value) * 300f);
            Hipass1.Update();
            Lowpass1.Update();
            Gain.SetParam(TFGain.P_GAIN, Utils.ExpResponse(ParameterInfo[P_GAIN].Value));
            Gain.SetParam(TFGain.P_RUETZ, Math.Round(ParameterInfo[P_RUETZ].Value));
            Gain.Update();
            HipassDC.Update();
            double freq = (1.0 / (2.0 * Math.PI * 0.0033e-6 * (2500 + 100000 * Utils.ExpResponse(ParameterInfo[P_FILTER].Value))));             // Range: 19292.0Hz to 470.0Hz

            Filter.SetParam(Lowpass1.P_FREQ, freq);
            Filter.Update();
            Hipass3.Update();

            if (e != null)
            {
                e.UpdateParameters();
            }
        }
Пример #4
0
        private void Update(int?parameter)
        {
            if (parameter == null)
            {
                HighpassInput.SetParam(Highpass1.P_FREQ, 180);
                h3.SetParam(Highpass1.P_FREQ, 59.45f);
                hipassZenerB.SetParam(Highpass1.P_FREQ, 8);
                LowpassOutput.SetParam(Lowpass1.P_FREQ, 10000);

                // Channel A ------------------------------------------------------
                TF1A.Update();
                TF2A.SetParam(TF2.P_USE_R3, 0.0);
            }

            if (parameter == null || parameter == P_GAIN_A)
            {
                TF2A.SetParam(TF2.P_GAIN, Utils.ExpResponse(ParameterInfo[P_GAIN_A].Value));
            }

            if (parameter == null)
            {
                PostVolumeHpA.SetParam(Highpass1.P_FREQ, 30);
                //Stage1A.Bias = -0.5f;
                Stage1A.Bias = -0.14f;
                Stage2A.Bias = -0.15f;
            }

            if (parameter == null || parameter == P_BASS_A || parameter == P_MID_A || parameter == P_TREBLE_A)
            {
                TonestackA.SetParam(Tonestack.P_BASS, Utils.ExpResponse(ParameterInfo[P_BASS_A].Value));
                TonestackA.SetParam(Tonestack.P_MID, ParameterInfo[P_MID_A].Value);
                TonestackA.SetParam(Tonestack.P_TREBLE, ParameterInfo[P_TREBLE_A].Value);
            }

            if (parameter == null || parameter == P_PRES_A)
            {
                TFPresA.SetParam(TFPres.P_PRES, ParameterInfo[P_PRES_A].Value);
            }

            // Channel B ------------------------------------------------------

            if (parameter == null)
            {
                TF1B.Update();
                TF2B.SetParam(TF2.P_USE_R3, 1.0);
                TF1xB.Update();
            }

            if (parameter == null || parameter == P_GAIN_B)
            {
                TF2B.SetParam(TF2.P_GAIN, Utils.ExpResponse(ParameterInfo[P_GAIN_B].Value));
            }

            if (parameter == null || parameter == P_VOL_B)
            {
                TFVolumeB.SetParam(TFVolume.P_VOL, Utils.ExpResponse(ParameterInfo[P_VOL_B].Value));
            }

            if (parameter == null)
            {
                Stage1B.Bias = 0.47 - 0.5f;
                Stage2B.Bias = 0.63 - 0.5f;
            }

            if (parameter == null || parameter == P_BASS_B || parameter == P_MID_B || parameter == P_TREBLE_B)
            {
                TonestackB.SetParam(Tonestack.P_BASS, Utils.ExpResponse(ParameterInfo[P_BASS_B].Value));
                TonestackB.SetParam(Tonestack.P_MID, ParameterInfo[P_MID_B].Value);
                TonestackB.SetParam(Tonestack.P_TREBLE, ParameterInfo[P_TREBLE_B].Value);
            }

            if (parameter == null || parameter == P_PRES_B)
            {
                TFPresB.SetParam(TFPres.P_PRES, ParameterInfo[P_PRES_B].Value);
            }

            if (Editor != null)
            {
                Editor.UpdateParameters();
            }
        }
Пример #5
0
        public void InitializeDevice()
        {
            DevInfo.DeviceID = "Low Profile - Rodent.V2";
#if DEBUG
            DevInfo.DeviceID = DevInfo.DeviceID + " - Dev";
#endif
            DevInfo.Developer    = "Valdemar Erlingsson";
            DevInfo.EditorHeight = e.Height;
            DevInfo.EditorWidth  = e.Width;
            DevInfo.HasEditor    = true;
            DevInfo.Name         = "Rodent V2";
            DevInfo.ProgramCount = 1;
            DevInfo.Type         = DeviceType.Effect;
            DevInfo.Version      = 2200;
            DevInfo.VstId        = DeviceUtilities.GenerateIntegerId(DevInfo.DeviceID);

            PortInfo[0].Direction        = PortDirection.Input;
            PortInfo[0].Name             = "Mono Input";
            PortInfo[0].NumberOfChannels = 1;

            PortInfo[1].Direction        = PortDirection.Output;
            PortInfo[1].Name             = "Stereo Output";
            PortInfo[1].NumberOfChannels = 2;

            for (int i = 0; i < ParameterInfo.Length; i++)
            {
                var p = new Parameter();
                p.Display        = "0.49";
                p.Index          = (uint)i;
                p.Name           = ParameterNames[i];
                p.Steps          = 0;
                p.Value          = 0.49;
                ParameterInfo[i] = p;
            }

            Hipass1  = new Highpass1((float)Samplerate);
            Lowpass1 = new Lowpass1((float)Samplerate);
            Gain     = new TFGain((float)Samplerate);
            HipassDC = new Highpass1((float)Samplerate);
            Clipper  = new SplineInterpolator(Splines.D1N914TF);

            /*Clipper2 = new LUT();
             * Clipper2.ReadRecord(Tables.LEDTF.Split('\n'));
             * Clipper2.Table = Tables.Upsample(Clipper2.Table, 100000);*/
            Clipper2 = new SplineInterpolator(Splines.LEDTF);

            Filter  = new Lowpass1((float)Samplerate);
            Hipass3 = new Highpass1((float)Samplerate);

            // Frequency of 0.01uF cap + 1k + 1Meg = 7.227 Hz
            Hipass1.SetParam(0, 10f + (float)Math.Round(ParameterInfo[P_TIGHT].Value) * 300f);
            // Low pass rolloff because of 1n cap, estimate
            Lowpass1.SetParam(0, 5000f);
            // This is the cap after the gain, just some value to remove DC offset
            HipassDC.SetParam(0, 10f);
            // Final cutoff frequency ~ 7.7Hz
            Hipass3.SetParam(0, 7.7f);

            SetParam(P_ON, 1.0);

            // initialize all blocks
            UpdateAll();

            e.UpdateParameters();
        }
Пример #6
0
        public void InitializeDevice()
        {
            DevInfo.DeviceID = "Low Profile - Smash Master";
#if DEBUG
            DevInfo.DeviceID = DevInfo.DeviceID + " - Dev";
#endif
            DevInfo.Developer    = "Valdemar Erlingsson";
            DevInfo.EditorHeight = 0;
            DevInfo.EditorWidth  = 0;
            DevInfo.HasEditor    = false;
            DevInfo.Name         = "Smash Master";
            DevInfo.ProgramCount = 1;
            DevInfo.Type         = DeviceType.Effect;
            DevInfo.Version      = 1000;
            DevInfo.VstId        = DeviceUtilities.GenerateIntegerId(DevInfo.DeviceID);

            PortInfo[0].Direction        = PortDirection.Input;
            PortInfo[0].Name             = "Stereo Input";
            PortInfo[0].NumberOfChannels = 2;

            PortInfo[1].Direction        = PortDirection.Output;
            PortInfo[1].Name             = "Stereo Output";
            PortInfo[1].NumberOfChannels = 2;

            for (int i = 0; i < ParameterInfo.Length; i++)
            {
                var p = new Parameter();
                p.Display        = "0.5";
                p.Index          = (uint)i;
                p.Name           = ParameterNames[i];
                p.Steps          = 0;
                p.Value          = 0.5;
                ParameterInfo[i] = p;
            }

            Hp1        = new Highpass1((float)Samplerate);
            LpNoise    = new Lowpass1((float)Samplerate);
            GainTF     = new Gain(this.Samplerate);
            PostGain   = new postGain(Samplerate);
            SaturateLP = new Lowpass1((float)Samplerate);
            ClipperHP  = new Highpass1((float)Samplerate);

            Clipper = new LUT();
            Clipper.ReadRecord(Tables.D1N914TF.Split('\n'));
            Clipper.Table = Tables.Upsample(Clipper.Table, 100000);

            Tonestack = new Tonestack((float)Samplerate);
            TF2       = new TF2(Samplerate);
            Contour   = new Contour(Samplerate);
            OutHP     = new Highpass1((float)Samplerate);
            OutLP     = new Lowpass1((float)Samplerate);

            // 16Hz, remove DC bias from input
            Hp1.SetParam(0, 16f);
            LpNoise.SetParam(0, 3500f);
            ClipperHP.SetParam(0, 10f);
            SaturateLP.SetParam(0, 15000);
            Tonestack.FenderMode = true;
            Tonestack.setComponents(0.022e-6, 0.22e-6, 0.022e-6, 1000, 5e6, 6.8e3, 25e3, 1e3, 100e3);
            OutHP.SetParam(0, 30f);

            // initialize all blocks
            UpdateAll();
        }