Inheritance: AudioLib.Modules.TransferVariable
示例#1
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();
        }
示例#2
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 Beta 4";
            DevInfo.ProgramCount = 1;
            DevInfo.Type = DeviceType.Effect;
            DevInfo.Version = 1004;
            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 LUT();
            Clipper.ReadRecord(Tables.D1N914TF.Split('\n'));
            Clipper.Table = Tables.Upsample(Clipper.Table, 100000);*/
            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();
        }