Example #1
0
 public void UpdateKeyMap()
 {
     for (int note = 48; note < 84; ++note)
     {
         KeyController._keymap[note] = KeyBinding.GetNoteToKey(note);
     }
 }
Example #2
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;
     }
 }
Example #3
0
 private void updateDisplay()
 {
     for (var i = 0; i < NUMBER_OF_KEY; i++)
     {
         keyBoxs[i].Text = KeyBinding.GetKeyChar(KeyBinding.GetNoteToKey(i + 48)).ToString();
     }
 }
Example #4
0
 private void KeyBindForm_Load(object sender, EventArgs e)
 {
     KeyBinding.LoadConfig();
     for (var i = 0; i < NUMBER_OF_KEY; i++)
     {
         keyBoxs[i].Text = KeyBinding.GetNoteToKey(i + 48).ToString();
     }
 }
Example #5
0
 private void KeyBindForm_Load(object sender, EventArgs e)
 {
     KeyBinding.LoadConfig();
     for (var i = 0; i < 12; i++)
     {
         keyBoxs[i].Text = KeyBinding.GetNoteToKey(i + 60).ToString();
     }
     keyBoxs[12].Text = KeyBinding.GetNoteToKey(84).ToString();
 }
Example #6
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));
         }
     }
 }
Example #7
0
        public void ResetKey()
        {
            this.isPlayingFlag = false;
            this.isRunningFlag = false;
            this.pauseOffset   = 0;
            this.KeyboardRelease(Keys.ControlKey);
            Thread.Sleep(1);
            this.KeyboardRelease(Keys.ShiftKey);
            Thread.Sleep(1);
            this.KeyboardRelease(Keys.Menu);
            Thread.Sleep(1);
            for (int note = 48; note < 84; ++note)
            {
                this.KeyboardRelease(KeyBinding.GetNoteToKey(note));
                Thread.Sleep(1);
            }

            ParameterController.GetInstance().Pitch = 0;
        }
Example #8
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));
                    }
                }
            }
        }
Example #9
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));
         }
     }
 }
Example #10
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;
            }
        }