Esempio n. 1
0
 public void KeyboardPress(int pitch)
 {
     if (pitch > 84 || pitch < 48)
     {
         return;
     }
     if (Settings.Default.IsEightKeyLayout)
     {
         this.KeyboardPress(KeyBinding.GetNoteToCtrlKey(pitch), KeyBinding.GetNoteToKey(pitch));
     }
     else if (this.isBackGroundKey)
     {
         this.bkKeyController.BackgroundKeyPress(KeyBinding.GetNoteToKey(pitch));
     }
     else
     {
         this.KeyboardPress(KeyBinding.GetNoteToKey(pitch));
     }
     ParameterController.GetInstance().NetSyncQueue.Enqueue(new Daigassou.Utils.TimedNote()
     {
         Note      = pitch - 24,
         StartTime = DateTime.Now
     });
     if (ParameterController.GetInstance().isEnsembleSync)
     {
         Log.overlayLog($"{pitch} pressed");
     }
     if (initFlag)
     {
         Log.overlayLog($"{pitch} note on");
         initFlag = false;
     }
 }
Esempio n. 2
0
 public static void KeyboardPress(int pitch)
 {
     if (pitch <= 84 && pitch >= 48)
     {
         if (Settings.Default.IsEightKeyLayout)
         {
             KeyboardPress(KeyBinding.GetNoteToCtrlKey(pitch), KeyBinding.GetNoteToKey(pitch));
         }
         else
         {
             KeyboardPress(KeyBinding.GetNoteToKey(pitch));
         }
     }
 }
Esempio n. 3
0
        public static void KeyboardRelease(int pitch)
        {
            lock (keyLock)
            {
#if DEBUG
                Console.WriteLine($@"{pitch} has been released at {Environment.TickCount}");
#endif
                if (pitch <= 84 && pitch >= 48)
                {
                    if (Settings.Default.IsEightKeyLayout)
                    {
                        KeyboardRelease(KeyBinding.GetNoteToCtrlKey(pitch), KeyBinding.GetNoteToKey(pitch));
                    }
                    else
                    {
                        KeyboardRelease(KeyBinding.GetNoteToKey(pitch));
                    }
                }
            }
        }
Esempio n. 4
0
 public void KeyboardRelease(int pitch)
 {
     lock (this.keyLock)
     {
         if (pitch > 84 || pitch < 48)
         {
             return;
         }
         if (Settings.Default.IsEightKeyLayout)
         {
             this.KeyboardRelease(KeyBinding.GetNoteToCtrlKey(pitch), KeyBinding.GetNoteToKey(pitch));
         }
         else if (this.isBackGroundKey)
         {
             this.bkKeyController.BackgroundKeyRelease(KeyBinding.GetNoteToKey(pitch));
         }
         else
         {
             this.KeyboardRelease(KeyBinding.GetNoteToKey(pitch));
         }
     }
 }
Esempio n. 5
0
        private void KeyBindForm_Load(object sender, EventArgs e)
        {
            KeyBinding.LoadConfig();
            for (var i = 0; i < 13; i++)
            {
                keyBoxs[i].Text = KeyBinding.GetKeyChar(KeyBinding.GetNoteToKey(i + 72)).ToString();
            }
            //keyBoxs[12].Text = KeyBinding.GetKeyChar(KeyBinding.GetNoteToKey(84)).ToString();
            var settingLower  = KeyBinding.GetNoteToCtrlKey(OCTAVE_KEY_LOW);
            var settingHigher = KeyBinding.GetNoteToCtrlKey(OCTAVE_KEY_HIGH);

            switch (settingLower)
            {
            case Keys.ControlKey: cbOctaveLower.Text = "Ctrl";
                break;

            case Keys.Menu: cbOctaveLower.Text = "Alt";
                break;

            case Keys.ShiftKey: cbOctaveLower.Text = "Shift";
                break;
            }

            switch (settingHigher)
            {
            case Keys.ControlKey:
                cbOctaveHigher.Text = "Ctrl";
                break;

            case Keys.Menu:
                cbOctaveHigher.Text = "Alt";
                break;

            case Keys.ShiftKey:
                cbOctaveHigher.Text = "Shift";
                break;
            }
        }