ソースの表示以前のリビジョンバックリンク全て展開する/折り畳む文書の先頭へ Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit Teams最近の変更Send via e-Mail印刷パーマリンク × 目次 Core MIDIの基礎 Mac OS XのMIDIアーキテクチャ MIDI Clientの詳細 参考文献 « Core MIDIに手を出してみる MacにgEDAをインストール » Core MIDIの基礎 てれってれー、とCore MIDI/Core Audioの資料とサンプルを見ながら試行錯誤してた所、意外と簡単にSMFプレーヤが出来てしまいました。Core MIDIの日本語資料は殆ど見かけないので、備忘録兼これからCore MIDI触んべよ!という方の手助けになればと、分かった事を記します。 お約束ですが、本記事内容の正確性については保証致し兼ねます(何分、拙い読解力で英文資料を読んでいる為)。また、本記事の内容により生じた損害等の責任は、一切負い兼ねますので悪しからずご了承下さい。間違い等を発見されましたら、容赦なくツッコんで頂けると幸いです。 Mac OS XのMIDIアーキテクチャ 下の図はMac OS XのMIDIアーキテクチャを示したものです。 色々と描いてありますが、ここでは「MIDI Server」と「MIDI Client + アプリケーション」にだけ着目します。 まず「MIDI Server」ですが、その名の通りMac OS XのMIDIサービスを統括・提供するものです。OS X上で扱うMIDIデータは須く、MIDI Serverを通る事になります。システムに接続されているMIDIデバイスの管理の役割も担います。 次に「MIDI Client + アプリケーション」です。アプリケーションは……まぁ説明不要でしょう。MIDI Clientは、アプリケーションがMIDI ServerとMIDIデータのやり取りを行うためのオブジェクトです。逆に言えば、OS XでMIDIを扱うアプリを作ろうとすれば、何らかの形でMIDI Clientのお世話になります。 上の図で、MIDI Clientがアプリ内部にある方は、アプリケーションが明示的にMIDI Clientを生成し利用している様子を、MIdI Clientがアプリの外側にある方は、アプリ内部ではより上位のMIDI APIを利用するなどして直接MIDI Clientを使ってはいないものの、上位APIの下ではMIDI Clientが動いている様子を、それぞれ表しています。 MIDI Clientの詳細 続いてMIDI Client部分の詳細を見て行きます。 それぞれ、下層のオブジェクトが上に載っているオブジェクトを含む、という構造になっています。つまり、Channel 1〜16はMIDI Endpointが持ち、MIDI EndpointはMIDI Portが持ち……という具合です。 MIDI規格では、1本のMIDIケーブルで最大16チャンネル(パート)の情報を伝送出来ますが、このケーブルに当たるのが図中のMIDI Endpointです。ケーブルというよりも、DIN5ピンのMIDI端子の仮想表現と言った方がいいかもしれません。MIDI Endpointは1つに付き16チャンネルのMIDIデータを扱え、プログラム中ではMIDI Endpointをインタフェースとして、MIDIデータのやり取りを行います。 MIDI Endopointは、システムに存在するMIDIポート(MIDI端子という意味でのMIDIポート。後述するMIDI Portとは別物)を割り当てなければなりません。この際、ポートのデータ方向(入力なのか出力なのか)を問わず、自由に割り当てることが出来ます。 MIDI Portは同一データ方向のMIDI Endpointを束ねる役割を持ちます。データ方向毎にMIDI Portを生成し、そこにデータ方向が同じMIDI Endpointを登録します。基本的には、入力用のMIDI Portと出力用のMIDI Portを1つずつ用意し、MIDI Endpointを登録することになります。 ですが、必ずしも入出力両方を用意する必要はなく、入力か出力で最低1つのMIDI PortがあればOKです。また、同一方向のMIDI Portをいくつか生成し、それぞれのMIDI Portに自由にMIDI Endpointを登録しても問題ないようです。1) 1つのMIDI PortはMIDI Endpointをいくつでも持つ事が出来ます。従って上図の構成では、入力として16チャンネル、出力として16 x 3 = 48チャンネル持っている事になります。 MIDI Clientは、MIDI ServerとMIDIデータをやり取りするために、MIDIアプリケーションの土台となるもので、アプリケーション毎に必ず1つは必要です。一応、同一アプリケーション内で2つ以上のMIDI Clientを生成し、それぞれでMIDI Portを作るという事も可能なようです。2) 他にもMIDI Entityという概念があったりしますが、これは存在意義と使い方がよく分からないので、割愛します。資料によれば「MIDI Driverによって定義される、MIDIデバイスの機能の論理的グループ表現」との事なので、挙動はMIDI Driverごとに違うものと思われます。 参考文献 長くなってきたので、以下に参考文献を示して、続きは次回にします。 Core MIDI Framework Reference Core MIDI(MIDI ClientとかMIDI Portとか)のリファレンス。 Audio and MIDI on Mac OS X 微妙にハブられた感のある資料。ファイル名もCoreAudio.pdfとバッティング寸前(CoreAudio.pdfの方はCore Audioメインの解説)。Core MIDIに関する事はこれにしか書いてないので注意。 1) 実験の結果。Appleの資料にはこの辺の記述が見当たらなかったので、正確なところは不明です。まぁ、生成時には識別子を指定するので大丈夫だとは思いますが…。 2) 上に同じ。 Comments ¡Un cordial saludo a todos los competidores del juego! Los casinos europeos ofrecen una experiencia de juego segura y variada. <a href=п»їhttps://casinosonlineeuropeos.xyz/>casinos europeos online</a> Muchos jugadores prefieren casinos online europeos por sus bonos atractivos y soporte en varios idiomas. Un mejores casinos en linea garantiza retiros rГЎpidos y mГ©todos de pago confiables. Los casinosonlineeuropeos ofrecen una experiencia de juego segura y variada. Muchos jugadores prefieren europa casino por sus bonos atractivos y soporte en varios idiomas. Un casinos online europeos garantiza retiros rГЎpidos y mГ©todos de pago confiables. Mejores casinos en lГnea con soporte en varios idiomas - https://casinosonlineeuropeos.xyz/# ¡Que goces de increíbles premios ! 1 | JefferyPsymn | 2025-08-13 01:47 | reply ?Brindemos por cada maestro del destino! Diversos apostadores comentan que http://estetiplan.es tiene un sistema estable y fГЎcil de usar. <a href=estetiplan.es/></a> La navegaciГіn es cГіmoda tanto en ordenador como en mГіvil. AsГ pueden apostar sin interrupciones. Usuarios frecuentes aseguran que https://www.estetiplan.es renueva sus promociones con buena regularidad. Esto motiva a regresar con mГЎs frecuencia. AdemГЎs, la dinГЎmica es sencilla de comprender. GUIA esencial disponible dentro de estetiplan.es/ - http://estetiplan.es ?Que la suerte te sonria con que el destino te ofrezca emocionantes giros de fortuna ! 2 | RaymondEvorn | 2025-12-04 08:01 | reply ?Brindemos por cada ganador del gran premio ! Varios expertos afirman que https://estetiplan.es/ presenta herramientas Гєtiles para apuestas en vivo. <a href=https://www.estetiplan.es/></a> Las actualizaciones son constantes y precisas. Esto mejora la experiencia durante los partidos. Diversos apostadores comentan que https://www.estetiplan.es/ tiene un sistema estable y fГЎcil de usar. La navegaciГіn es cГіmoda tanto en ordenador como en mГіvil. AsГ pueden apostar sin interrupciones. GuГa para navegar mejor en https://estetiplan.es/ - https://www.estetiplan.es/ ?Que la suerte te sonria con que vivas soberbios jackpots esplendidos ! 3 | RaymondEvorn | 2025-12-05 03:34 | reply ?Celebremos a cada explorador de tesoros ! Jugar en casino sin dni permite acceder a una experiencia rГЎpida y privada sin procesos complicados. <a href=п»їhttps://casinoretirosinverificacion.com/></a> Muchos jugadores optan por estas opciones debido a la libertad que ofrecen plataformas como casinoretirosinverificacion.com. Gracias a esta flexibilidad, cada sesiГіn se vuelve mГЎs cГіmoda al usar servicios como casino sin registro. Jugar en Casino sin KYC permite acceder a una experiencia rГЎpida y privada sin procesos complicados. Muchos jugadores optan por estas opciones debido a la libertad que ofrecen plataformas como casinos sin verificaciГіn. Gracias a esta flexibilidad, cada sesiГіn se vuelve mГЎs cГіmoda al usar servicios como casinos sin kyc. Casinos sin verificacion, entretenimiento al instante - http://casinoretirosinverificacion.com/ ?Que la suerte te beneficie con que goces de extraordinarios lanzamientos prosperos ! 4 | ScottJed | 2025-12-05 08:34 | reply Name E-Mail Website 人間の証明として、ボックス内の全ての文字を入力してください。 この項目は空のままにして下さい:Preview Comment blog/2007/2007-10-03.txt 最終更新: 2015-03-07 22:08by Decomo