Help us understand the problem. What is going on with this article?

C#でMIDI通信を扱うNext MIDI Projectで受信する

More than 1 year has passed since last update.

C#でMIDI通信を扱う

Next MIDI Project (MITライセンス)
http://starway.s234.xrea.com/wordpress/

にて、MIDIを受信するサンプル

このコードはCC0ライセンスとして公開

using System;
using NextMidi.MidiPort.Input.Core;
using NextMidi.MidiPort.Output.Core;
using NextMidi.MidiPort.Input;
using Avenue;
using NextMidi.DataElement;
using System.Threading;

//http://starway.s234.xrea.com/wordpress/
namespace MIDIControllerTestConsole
{
    class Program
    {
        //受信イベント
        static void MidiReceived(object sender, DataEventArgs<MidiEvent> e)
        {
            byte[] data = e.Value.ToNativeEvent(); //MIDI生値に変換
            foreach (var d in data) {
                Console.Write("{0:X2},",d);
            }
            Console.Write("\n");
        }

        static void Main(string[] args)
        {
            //ポートを開く
            var port = new MidiInPort("loopMIDI Port");
            try
            {
                port.Open();
            }
            catch
            {
                Console.WriteLine("ポートが見つかりません");
                return;
            }

            //受信イベント登録
            port.Received += MidiReceived;

            //なにかキーを押すと終了
            while (!Console.KeyAvailable) {
                Console.WriteLine("Keep-Alive");
                Thread.Sleep(1000);
            }
        }
    }
}

gpsnmeajp
電子工作が主な趣味ですが、PC用のツールを作るのも好きです。 特にライセンスを明記していないソースコードのライセンスについてはCC0です。
https://sabowl.sakura.ne.jp/gpsnmeajp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした