示例#1
0
        public void hexter_instance_set_performance_data()
        {
            byte[] perf_buffer = this.performance_buffer;

            /* set instance performance parameters */
            /* -FIX- later these will optionally come from patch */
            this.pitch_bend_range      = (byte)Inline.limit(perf_buffer[3], 0, 12);
            this.portamento_time       = (byte)Inline.limit(perf_buffer[5], 0, 99);
            this.mod_wheel_sensitivity = (byte)Inline.limit(perf_buffer[9], 0, 15);
            this.mod_wheel_assign      = (byte)Inline.limit(perf_buffer[10], 0, 7);
            this.foot_sensitivity      = (byte)Inline.limit(perf_buffer[11], 0, 15);
            this.foot_assign           = (byte)Inline.limit(perf_buffer[12], 0, 7);
            this.pressure_sensitivity  = (byte)Inline.limit(perf_buffer[13], 0, 15);
            this.pressure_assign       = (byte)Inline.limit(perf_buffer[14], 0, 7);
            this.breath_sensitivity    = (byte)Inline.limit(perf_buffer[15], 0, 15);
            this.breath_assign         = (byte)Inline.limit(perf_buffer[16], 0, 7);
            if ((perf_buffer[0] & 0x01) != 0)
            { /* 0.5.9 compatibility */
                this.pitch_bend_range      = 2;
                this.portamento_time       = 0;
                this.mod_wheel_sensitivity = 0;
                this.foot_sensitivity      = 0;
                this.pressure_sensitivity  = 0;
                this.breath_sensitivity    = 0;
            }
        }
示例#2
0
        public void dx7_voice_set_data(hexter_instance instance)
        {
            byte[] edit_buffer = instance.current_patch_buffer;
            bool   compat059 = (instance.performance_buffer[0] & 0x01) > 0 ? true : false; /* 0.5.9 compatibility */
            int    i, j;
            double aux_feedbk;

            for (i = 0; i < Constants.MAX_DX7_OPERATORS; i++)
            {
                byte[] eb_op  = edit_buffer;
                int    offset = ((5 - i) * 21);

                this.op[i].output_level = (byte)(Inline.limit(eb_op[16 + offset], 0, 99));

                this.op[i].osc_mode = (byte)(eb_op[17 + offset] & 0x01);
                this.op[i].coarse   = (byte)(eb_op[18 + offset] & 0x1f);
                this.op[i].fine     = (byte)(Inline.limit(eb_op[19 + offset], 0, 99));
                this.op[i].detune   = (byte)(Inline.limit(eb_op[20 + offset], 0, 14));

                this.op[i].level_scaling_bkpoint = (byte)(Inline.limit(eb_op[8 + offset], 0, 99));
                this.op[i].level_scaling_l_depth = (byte)(Inline.limit(eb_op[9 + offset], 0, 99));
                this.op[i].level_scaling_r_depth = (byte)(Inline.limit(eb_op[10 + offset], 0, 99));
                this.op[i].level_scaling_l_curve = (byte)(eb_op[11 + offset] & 0x03);
                this.op[i].level_scaling_r_curve = (byte)(eb_op[12 + offset] & 0x03);
                this.op[i].rate_scaling          = (byte)(eb_op[13 + offset] & 0x07);
                this.op[i].amp_mod_sens          = (byte)((compat059 ? 0 : eb_op[14 + offset] & 0x03));
                this.op[i].velocity_sens         = (byte)(eb_op[15 + offset] & 0x07);

                for (j = 0; j < 4; j++)
                {
                    this.op[i].eg.base_rate[j]  = (byte)(Inline.limit(eb_op[j + offset], 0, 99));
                    this.op[i].eg.base_level[j] = (byte)(Inline.limit(eb_op[4 + j + offset], 0, 99));
                }
            }

            for (i = 0; i < 4; i++)
            {
                this.pitch_eg.rate[i]  = (byte)(Inline.limit(edit_buffer[126 + i], 0, 99));
                this.pitch_eg.level[i] = (byte)(Inline.limit(edit_buffer[130 + i], 0, 99));
            }

            this.algorithm = (byte)(edit_buffer[134] & 0x1f);

            aux_feedbk = (double)(edit_buffer[135] & 0x07) / (2.0 * Constants.M_PI) * 0.18 /* -FIX- feedback_scaling[this.algorithm] */;

            /* the "99.0" here is because we're also using this multiplier to scale the
             * eg level from 0-99 to 0-1 */
            this.feedback_multiplier = (int)Math.Round(aux_feedbk / 99.0 * Constants.FP_SIZE);

            this.osc_key_sync = (byte)(edit_buffer[136] & 0x01);

            this.lfo_speed    = (byte)(Inline.limit(edit_buffer[137], 0, 99));
            this.lfo_delay    = (byte)(Inline.limit(edit_buffer[138], 0, 99));
            this.lfo_pmd      = (byte)(Inline.limit(edit_buffer[139], 0, 99));
            this.lfo_amd      = (byte)(Inline.limit(edit_buffer[140], 0, 99));
            this.lfo_key_sync = (byte)(edit_buffer[141] & 0x01);
            this.lfo_wave     = (byte)(Inline.limit(edit_buffer[142], 0, 5));
            this.lfo_pms      = (byte)((compat059 ? 0 : edit_buffer[143] & 0x07));

            this.transpose = Inline.limit(edit_buffer[144], 0, 48);
        }