示例#1
0
        public void AddDrum(GuiDrumPad pad,
                            NumericUpDown nupNoteNormal, NumericUpDown nupNoteAdv,
                            CheckBox chkBoostOn, CheckBox chkBoostOnAdv,
                            ComboBox ddlBoostValue, ComboBox ddlAdvBoostValue)
        {
            m_NupNoteArray[(byte)pad]    = nupNoteNormal;
            m_NupAdvNoteArray[(byte)pad] = nupNoteAdv;

            m_ChkDrumBoostOn[(byte)pad]    = chkBoostOn;
            m_ChkAdvDrumBoostOn[(byte)pad] = chkBoostOnAdv;

            m_DdlBoostValue[(byte)pad]    = ddlBoostValue;
            m_DdlAdvBoostValue[(byte)pad] = ddlAdvBoostValue;


            InitControl((byte)pad, GuiLinkerType.DrumPad, nupNoteNormal);
            InitControl((byte)pad, GuiLinkerType.DrumPad, nupNoteAdv);
            InitControl((byte)pad, GuiLinkerType.DrumPad, chkBoostOn);
            InitControl((byte)pad, GuiLinkerType.DrumPad, chkBoostOnAdv);
            InitControl((byte)pad, GuiLinkerType.DrumPad, ddlBoostValue);
            InitControl((byte)pad, GuiLinkerType.DrumPad, ddlAdvBoostValue);

            InitNumericUpDown(nupNoteNormal);
            InitNumericUpDown(nupNoteAdv);

            InitDDLBoost(ddlBoostValue);
            InitDDLBoost(ddlAdvBoostValue);

            InitBoostCheckBox(chkBoostOn);
            InitBoostCheckBox(chkBoostOnAdv);
        }
示例#2
0
        private byte Boost(byte rawpad, byte velocity)
        {
            GuiDrumPad pad = m_RawToGuiConverter.TranslatePad(rawpad);

            if (m_Main.GuiLinker.GetBoostEnabled(pad))
            {
                velocity = (byte)Math.Min((byte)255, velocity + m_Main.GuiLinker.GetBoost(pad));
            }
            return(velocity);
        }
示例#3
0
        public bool Morph(GuiDrumPad pad, ref byte velocity, ref byte note)
        {
            bool changed = false;

            foreach (MultiNote mn in m_lb.Items)
            {
                changed = mn.Morph(pad, ref velocity, ref note);
            }
            return(changed);
        }
示例#4
0
 internal bool GetBoostEnabled(GuiDrumPad pad)
 {
     if (m_Main.InvokeRequired)
     {
         return((bool)m_Main.Invoke(new Bool_DrumPadDelegate(GetBoostEnabled), new object[] { pad }));
     }
     else
     {
         return(m_ChkAdvDrumBoostOn[(byte)pad].Checked);
     }
 }
示例#5
0
 internal byte GetBoost(GuiDrumPad pad)
 {
     if (m_Main.InvokeRequired)
     {
         return((byte)m_Main.Invoke(new Byte_DrumPadDelegate(GetBoost), new object[] { pad }));
     }
     else
     {
         return((byte)m_DdlAdvBoostValue[(byte)pad].SelectedItem);
     }
 }
示例#6
0
 public MultiNote(MultNoteCheckType checkType, byte velocity,
                  GuiDrumPad pad, byte noteTo,
                  float velMult, byte velAdd)
 {
     CheckType    = checkType;
     Velocity     = velocity;
     Pad          = pad;
     NoteTo       = noteTo;
     VelocityMult = velMult;
     VelocityAdd  = velAdd;
 }
示例#7
0
 public void UpdateVelocityPb(GuiDrumPad pad, byte hitVelocity)
 {
     if (InvokeRequired)
     {
         Invoke(new Void_DrumPadByteDelegate(UpdateVelocityPb), new object[] { pad, hitVelocity });
     }
     else
     {
         referenceVelocity[(int)pad].Value = hitVelocity;
     }
 }
示例#8
0
 public bool Morph(GuiDrumPad pad, ref byte velocity, ref byte note)
 {
     if (Pad == pad && VelocityCheck(velocity))
     {
         note     = NoteTo;
         velocity = (byte)Math.Max(0, Math.Min(127, velocity * VelocityMult + VelocityAdd));
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#9
0
 public bool Morph(GuiDrumPad pad, ref byte velocity, ref byte note)
 {
     if (Pad == pad && VelocityCheck(velocity))
     {
         note = NoteTo;
         velocity = (byte)Math.Max(0, Math.Min(127, velocity * VelocityMult + VelocityAdd));
         return true;
     }
     else
     {
         return false;
     }
 }
示例#10
0
        public void TriggerNote(byte rawpad, byte velocity)
        {
            velocity = Boost(rawpad, velocity);
            if (m_HitVelocities[rawpad] == null) // No note recently triggered
            {
                GuiDrumPad pad = m_RawToGuiConverter.TranslatePad(rawpad);
                m_Main.MidiSender.TriggerNote(pad, velocity);

                m_HitVelocities[(int)rawpad] = velocity;
                m_Timers[rawpad].Start();
            }
            // Otherwise, the note is ignored.
        }
示例#11
0
        public void TriggerNote(GuiDrumPad pad, byte hitVelocity)
        {
            // Maximum value is 127
            hitVelocity = (byte)(hitVelocity / 2);
            System.Diagnostics.Debug.Assert(hitVelocity <= 127);

            byte note = m_Main.GuiLinker.GetMidiNote(pad);
            m_Main.MultiNoteGui.Morph(pad, ref hitVelocity, ref note);

            SendNoteOn(note, hitVelocity);
            m_Main.UpdateVelocityPb(pad, hitVelocity);
            SendNoteOff(note);
        }
示例#12
0
        public MultiNote(MultNoteCheckType checkType, byte velocity,
                         GuiDrumPad pad, byte noteTo,
                         float velMult, byte velAdd)
        {
            Velocity = velocity;
            CheckType = checkType;

            Pad = pad;
            NoteTo = noteTo;

            VelocityMult = velMult;
            VelocityAdd = velAdd;
        }
示例#13
0
        public void TriggerNote(GuiDrumPad pad, byte hitVelocity)
        {
            // Maximum value is 127
            hitVelocity = (byte)(hitVelocity / 2);
            System.Diagnostics.Debug.Assert(hitVelocity <= 127);

            byte note = m_Main.GuiLinker.GetMidiNote(pad);

            m_Main.MultiNoteGui.Morph(pad, ref hitVelocity, ref note);

            SendNoteOn(note, hitVelocity);
            m_Main.UpdateVelocityPb(pad, hitVelocity);
            SendNoteOff(note);
        }
示例#14
0
 internal byte GetBoost(GuiDrumPad pad)
 {
     if (m_Main.InvokeRequired)
     {
         return (byte)m_Main.Invoke(new Byte_DrumPadDelegate(GetBoost), new object[] { pad });
     }
     else
     {
         return (byte)m_DdlAdvBoostValue[(byte)pad].SelectedItem;
     }
 }
示例#15
0
 public bool Morph(GuiDrumPad pad, ref byte velocity, ref byte note)
 {
     bool changed = false;
     foreach (MultiNote mn in m_lb.Items)
     {
         changed = mn.Morph(pad, ref velocity, ref note);
     }
     return changed;
 }
示例#16
0
 internal void SetMidiNote(GuiDrumPad pad, byte note)
 {
     m_NupAdvNoteArray[(byte)pad].Value = note;
     m_NupNoteArray[(byte)pad].Value = note;
 }
示例#17
0
 internal void SetBoostValue(GuiDrumPad pad, byte value)
 {
     SetSelectIndex(ref m_DdlAdvBoostValue[(byte)pad], value);
     SetSelectIndex(ref m_DdlBoostValue[(byte)pad], value);
 }
示例#18
0
 internal void SetBoostEnabled(GuiDrumPad pad, bool enabled)
 {
     m_ChkDrumBoostOn[(byte)pad].Checked = enabled;
     m_ChkAdvDrumBoostOn[(byte)pad].Checked = enabled;
 }
示例#19
0
 internal byte GetMidiNote(GuiDrumPad pad)
 {
     return (byte)m_NupAdvNoteArray[(byte)pad].Value;
 }
示例#20
0
 public void UpdateVelocityPb(GuiDrumPad pad, byte hitVelocity)
 {
     if (InvokeRequired)
     {
         Invoke(new Void_DrumPadByteDelegate(UpdateVelocityPb), new object[] { pad, hitVelocity });
     }
     else
     {
         referenceVelocity[(int)pad].Value = hitVelocity;
     }
 }
示例#21
0
        public void AddDrum(GuiDrumPad pad,
                     NumericUpDown nupNoteNormal, NumericUpDown nupNoteAdv,
                     CheckBox chkBoostOn, CheckBox chkBoostOnAdv,
                     ComboBox ddlBoostValue, ComboBox ddlAdvBoostValue)
        {
            m_NupNoteArray[(byte)pad] = nupNoteNormal;
            m_NupAdvNoteArray[(byte)pad] = nupNoteAdv;

            m_ChkDrumBoostOn[(byte)pad] = chkBoostOn;
            m_ChkAdvDrumBoostOn[(byte)pad] = chkBoostOnAdv;

            m_DdlBoostValue[(byte)pad] = ddlBoostValue;
            m_DdlAdvBoostValue[(byte)pad] = ddlAdvBoostValue;

            InitControl((byte)pad, GuiLinkerType.DrumPad, nupNoteNormal);
            InitControl((byte)pad, GuiLinkerType.DrumPad, nupNoteAdv);
            InitControl((byte)pad, GuiLinkerType.DrumPad, chkBoostOn);
            InitControl((byte)pad, GuiLinkerType.DrumPad, chkBoostOnAdv);
            InitControl((byte)pad, GuiLinkerType.DrumPad, ddlBoostValue);
            InitControl((byte)pad, GuiLinkerType.DrumPad, ddlAdvBoostValue);

            InitNumericUpDown(nupNoteNormal);
            InitNumericUpDown(nupNoteAdv);

            InitDDLBoost(ddlBoostValue);
            InitDDLBoost(ddlAdvBoostValue);

            InitBoostCheckBox(chkBoostOn);
            InitBoostCheckBox(chkBoostOnAdv);
        }
示例#22
0
 internal byte GetMidiNote(GuiDrumPad pad)
 {
     return((byte)m_NupAdvNoteArray[(byte)pad].Value);
 }
示例#23
0
 internal void SetMidiNote(GuiDrumPad pad, byte note)
 {
     m_NupAdvNoteArray[(byte)pad].Value = note;
     m_NupNoteArray[(byte)pad].Value    = note;
 }
示例#24
0
 internal void SetBoostValue(GuiDrumPad pad, byte value)
 {
     SetSelectIndex(ref m_DdlAdvBoostValue[(byte)pad], value);
     SetSelectIndex(ref m_DdlBoostValue[(byte)pad], value);
 }
示例#25
0
 internal bool GetBoostEnabled(GuiDrumPad pad)
 {
     if (m_Main.InvokeRequired)
     {
         return (bool)m_Main.Invoke(new Bool_DrumPadDelegate(GetBoostEnabled), new object[] { pad });
     }
     else
     {
         return m_ChkAdvDrumBoostOn[(byte)pad].Checked;
     }
 }
示例#26
0
 internal void SetBoostEnabled(GuiDrumPad pad, bool enabled)
 {
     m_ChkDrumBoostOn[(byte)pad].Checked    = enabled;
     m_ChkAdvDrumBoostOn[(byte)pad].Checked = enabled;
 }