Exemplo n.º 1
0
        public Distortion()
        {
            this.effect_name = "Distortion";
            DistortionParams dp = new DistortionParams();

            this.parameters = dp;
            Form_Distortion form = new Form_Distortion();

            form.effect = this;
            controler   = form;
            dp.enable   = true;


            dp.sat       = 0.7f;
            dp.level     = .6f;
            dp.drive     = 10;
            dp.lowpass   = 350;
            dp.noisegate = 1000;

            RCFilter.RC_setup(1, 1, dp.fd);
            RCFilter.RC_set_freq(dp.lowpass, dp.fd);

            RCFilter.RC_setup(1, 1, dp.noise);
            RCFilter.RC_set_freq(dp.noisegate, dp.noise);
        }
        public Autowah()
        {
            this.effect_name = "Autowah";
            AutowahParams ap = new AutowahParams();

            this.parameters = ap;

            ap.freq_high = 1000;
            ap.freq_low  = 150;
            ap.f         = 150;
            ap.wah_count = 0;
            ap.mixx      = 0;



            ap.df = (float)((ap.freq_high - ap.freq_low) * 1000.0 * sys.buffer_size / (sys.sample_rate *
                                                                                       sys.nchannels *
                                                                                       (float)500));

            ap.fd     = new FilterData();
            ap.enable = true;


            RCFilter.RC_setup(10, 1.5, ap.fd);
            RCFilter.RC_set_freq(ap.f, ap.fd);

            Form_Autowah form = new Form_Autowah();

            form.effect = this;
            controler   = form;
        }
Exemplo n.º 3
0
 public void freq_low_changed(long freq)
 {
     freq_low = (float)freq;
     f        = freq_low;
     RCFilter.RC_setup(10, 1.5, fd);
     RCFilter.RC_set_freq(f, fd);
 }
        void update_wah_freqhi(int adj_value)
        {
            AutowahParams ap = (AutowahParams)this.parameters;

            ap.freq_high = (float)adj_value;
            RCFilter.RC_setup(10, 1.5, ap.fd);
            RCFilter.RC_set_freq(ap.f, ap.fd);
        }
        public void update_wah_freqlow(int adj_value)
        {
            AutowahParams ap = (AutowahParams)this.parameters;

            ap.freq_low = (float)adj_value;
            ap.f        = ap.freq_low;
            RCFilter.RC_setup(10, 1.5, ap.fd);
            RCFilter.RC_set_freq(ap.f, ap.fd);
        }
Exemplo n.º 6
0
        public override void process_int(Channel input1, Channel left_op1, Channel right_op1)
        {
            // (struct effect *p, struct data_block *db)

            Channel      db = input1;
            PhasorParams pp = (PhasorParams)this.parameters;

            RCFilter.LC_filter(db, db.BufferSize, sys.HIGHPASS, pp.f, pp.fd);

            if (pp.bandpass != 0)
            {
                RCFilter.RC_bandpass(db, db.BufferSize, (pp.fd));
            }

            pp.f += pp.df;
            if (pp.f >= pp.freq_high || pp.f <= pp.freq_low)
            {
                pp.df = -pp.df;
            }

            RCFilter.RC_set_freq(pp.f, (pp.fd));
        }
Exemplo n.º 7
0
        public Phasor()
        {
            effect_name = "Phasor";
            PhasorParams pp = new PhasorParams();

            parameters = pp;
            pp.enable  = true;
            Form_Phasor fp = new Form_Phasor();

            fp.phasor = this;
            controler = fp;


            pp.freq_low  = 300.0f;
            pp.freq_high = 2500.0f;
            pp.f         = pp.freq_low;
            pp.df        = 42.0f;
            pp.bandpass  = 0;


            RCFilter.RC_setup(10, 1.25, (pp.fd));
            RCFilter.RC_set_freq(pp.f, (pp.fd));
        }
        public override void process_int(Channel input1, Channel left_op1, Channel right_op1)
        {
            //throw new NotImplementedException();

            if (parameters.enable)
            {
                AutowahParams ap;
                ap = (AutowahParams)this.parameters;

                float[] dry = new float[input1.BufferSize];

                for (int ii = 0; ii < input1.BufferSize; ii++)
                {
                    dry[ii] = input1[ii];
                }

                int i;



                /*
                 *  if (ap->wah_count != 0) {
                 *  LC_filter(db->data, db->len, HIGHPASS,ap->freq_high, ap->fd);
                 *  }
                 */

                ap.f += ap.df;
                if (ap.f >= ap.freq_high)
                {
                    ap.df        = -ap.df;
                    ap.wah_count = 2;
                }

                if (ap.f <= ap.freq_low && ap.wah_count == 2)
                {
                    ap.wah_count = 0;
                }

                if (ap.wah_count == 1)
                {
                    ap.df        = 0;
                    ap.f         = ap.freq_low;
                    ap.wah_count = 0;
                }

                if (ap.df != 0)
                {
                    RCFilter.RC_bandpass(input1, input1.BufferSize, ap.fd);
                }

                ap.f += ap.df;
                if (ap.f >= ap.freq_high || ap.f <= ap.freq_low)
                {
                    ap.df         = -ap.df;
                    ap.wah_count += 2;

                    if (ap.df != 0)
                    {
                        ap.wah_count++;
                    }
                }

                RCFilter.RC_set_freq(ap.f, ap.fd);

                if (ap.mixx == 1)
                {
                    for (i = 0; i < input1.BufferSize; i++)
                    {
                        input1[i] = (input1[i] + dry[i]) / 2;
                    }
                }
            }
        }
Exemplo n.º 9
0
        public override void process_int(Channel input1, Channel left_op1, Channel right_op1)
        {
            if (this.parameters.enable)
            {
                Effect  p  = this;
                Channel db = input1;

                int count,
                    currchannel = 0;
                Channel          s;
                DistortionParams dp;

                dp = (DistortionParams)this.parameters;

                /*
                 * sat clips derivative by limiting difference between samples. Use lastval
                 * member to store last sample for seamlessness between chunks.
                 */
                count = db.BufferSize;
                s     = input1;;

                RCFilter.RC_highpass(input1, input1.BufferSize, dp.fd);

                int i = 0;
                while (count > 0)
                {
                    /*
                     * apply drive
                     */
                    input1[i] *= dp.drive;
                    //   input1[i] /= 16;

                    /*
                     * apply sat
                     */



                    if ((s[i] - dp.lastval[currchannel]) > dp.sat)
                    {
                        s[i] = dp.lastval[currchannel] + dp.sat;
                    }
                    else if ((dp.lastval[currchannel] - s[i]) > dp.sat)
                    {
                        s[i] = dp.lastval[currchannel] - dp.sat;
                    }

                    dp.lastval[currchannel] = input1[i];


                    input1[i] *= dp.level;
                    //input1[i] /= 256;

                    // debug

                    count--;
                    i++;
                }

                RCFilter.LC_filter(db, db.BufferSize, sys.LOWPASS, dp.lowpass, dp.noise);
            }
        }
Exemplo n.º 10
0
 public void freq_high_changed(long reeq_hi)
 {
     freq_high = (float)reeq_hi;
     RCFilter.RC_setup(10, 1.5, fd);
     RCFilter.RC_set_freq(f, fd);
 }