public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX, bool is_first_gain = false, int CH_INDEX = 0)
        {
            if(this.Muted)
                {
                    PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(-100), 3, 29)));
                } else
                {
                    if(is_first_gain)
                    {
                        UInt32 new_val = DSP_Math.double_to_MN(this.Gain + PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].pregains[CH_INDEX], 9, 23);

                        // Notice that this is a
                        PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, new_val));

                        // Save this for the first node so we can remember
                        PARENT_FORM.AddItemToQueue(new LiveQueueItem((416 + CH_INDEX), DSP_Math.double_to_MN(this.Gain, 6, 26)));

                    } else
                    {
                        PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(this.Gain), 3, 29)));
                    }

                }
        }
        public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX, int PLAINFILTER_INDEX, int CH_NUMBER)
        {
            UInt32 B0 = 0x20000000;
            UInt32 B1 = 0x00000000;
            UInt32 B2 = 0x00000000;
            UInt32 A1 = 0x00000000;
            UInt32 A2 = 0x00000000;

            UInt32 PACKAGE = 0x00000000;
            UInt32 PACKAGE_GAIN = 0x00000000;
            UInt32 PACKAGE_Q = 0x00000000;

            if(this.Type == FilterType.None)
            {
                B0 = 0x20000000;
                B1 = 0x00000000;
                B2 = 0x00000000;
                A1 = 0x00000000;
                A2 = 0x00000000;

                PACKAGE = 0x00000000;
                PACKAGE_GAIN = 0x00000000;
                PACKAGE_Q = 0x00000000;
            } else if(this.Bypassed)
            {
                B0 = 0x20000000;
                B1 = 0x00000000;
                B2 = 0x00000000;
                A1 = 0x00000000;
                A2 = 0x00000000;

                PACKAGE = DSP_Math.filter_to_package(this);
                PACKAGE_GAIN = DSP_Math.double_to_MN(this.Filter.Gain, 8, 24);
                PACKAGE_Q = DSP_Math.double_to_MN(this.Filter.QValue, 8, 24);
            } else
            {
                B0 = DSP_Math.double_to_MN(this.Filter.B0, 3, 29);
                B1 = DSP_Math.double_to_MN(this.Filter.B1, 3, 29);
                B2 = DSP_Math.double_to_MN(this.Filter.B2, 3, 29);
                A1 = DSP_Math.double_to_MN(this.Filter.A1 * -1, 2, 30);
                A2 = DSP_Math.double_to_MN(this.Filter.A2 * -1, 2, 30);

                PACKAGE = DSP_Math.filter_to_package(this);
                PACKAGE_GAIN = DSP_Math.double_to_MN(this.Filter.Gain, 8, 24);
                PACKAGE_Q = DSP_Math.double_to_MN(this.Filter.QValue, 8, 24);
            }

            // MUTE THE CHANNEL OUTPUT GAIN TO REDUCE CRAZY NOISES..

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(36 + (CH_NUMBER - 1), 0x00000000));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, B0));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 1, B1));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 2, B2));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 3, A1));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 4, A2));

            UInt32 gain_val = DSP_Math.double_to_MN(DSP_Math.decibels_to_voltage_gain(PARENT_FORM.PROGRAMS[PARENT_FORM.CURRENT_PROGRAM].gains[CH_NUMBER - 1][3].Gain), 3, 29);
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(36 + (CH_NUMBER - 1), gain_val));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX, PACKAGE));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX + 1, PACKAGE_GAIN));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(PLAINFILTER_INDEX + 2, PACKAGE_Q));
        }
 public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX)
 {
     PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(this.Delay, 16, 16)));
 }
        public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX)
        {
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX, DSP_Math.double_to_MN(this.Threshold, 9, 23)));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 1, DSP_Math.dynamic_hold_to_value(this.Holdtime)));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 2, DSP_Math.double_to_MN(this.Depth, 9, 23)));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 3, DSP_Math.comp_attack_to_value(this.Attack)));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 4, DSP_Math.comp_release_to_value(this.Release)));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 5, Convert.ToUInt32(this.Bypassed)));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 6, (uint)this.RouterInputs[0]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 7, (uint)this.RouterInputs[1]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 8, (uint)this.RouterInputs[2]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 9, (uint)this.RouterInputs[3]));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 10, (uint)this.RouterOutputs[0]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 11, (uint)this.RouterOutputs[1]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 12, (uint)this.RouterOutputs[2]));
            PARENT_FORM.AddItemToQueue(new LiveQueueItem(SETTINGS_INDEX + 13, (uint)this.RouterOutputs[3]));
        }
        public void QueueChange(MainForm_Template PARENT_FORM, int SETTINGS_INDEX)
        {
            int ADDR_THRESHOLD =    SETTINGS_INDEX;
            int ADDR_KNEE =         SETTINGS_INDEX + 1;
            int ADDR_RATIO =        SETTINGS_INDEX + 2;
            int ADDR_ATTACK =       SETTINGS_INDEX + 3;
            int ADDR_RELEASE =      SETTINGS_INDEX + 4;
            int ADDR_BYPASS =       SETTINGS_INDEX + 5;

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_THRESHOLD, DSP_Math.double_to_MN(this.Threshold, 9, 23)));

            if (this.SoftKnee)
            {
                PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_KNEE, 0x03000000));
            }
            else
            {
                PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_KNEE, 0x00000000));
            }

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_RATIO, DSP_Math.comp_ratio_to_value(this.Ratio)));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_ATTACK, DSP_Math.comp_attack_to_value(this.Attack)));

            PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_RELEASE, DSP_Math.comp_release_to_value(this.Release)));

            if (this.Bypassed)
            {
                PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_BYPASS, 0x00000001));
            }
            else
            {
                PARENT_FORM.AddItemToQueue(new LiveQueueItem(ADDR_BYPASS, 0x00000000));
            }
        }