コード例 #1
0
 private void MidiProc(IntPtr hMidiIn,
                       int wMsg,
                       IntPtr dwInstance,
                       int dwParam1,
                       int dwParam2)
 {
     if (wMsg == 963)
     {
         if ((byte)(dwParam1 >> 0) == 144)
         {
             //string num = Convert.ToString(dwParam1, 2).PadLeft(32, '0');
             //Console.WriteLine(dwParam1 >> 15);
             if ((byte)(dwParam1 >> 16) != 0)
             {
                 synth.PianoKeyPress((byte)(dwParam1 >> 8) - 60);
             }
             else
             {
                 synth.PianoKeyRelease((byte)(dwParam1 >> 8) - 60);
             }
         }
     }
 }