ラベル iOS の投稿を表示しています。 すべての投稿を表示
ラベル iOS の投稿を表示しています。 すべての投稿を表示

2021年8月16日月曜日

Unityアセット「MIDI Plugin for Mobile and Desktop」紹介(2026年更新)

最終更新: 2026-09-27 / 対象アセット版: 2.0.3

MIDI Plugin for Mobile and Desktop — Asset Store カバー画像

MIDI Plugin for Mobile and Desktop (Unity Asset Store)

ドキュメント(購入前でも閲覧可): マニュアル全文は supports リポジトリ で公開しています。入口は documents/index.md、 または README にある結合版 Markdown / PDF(英語 / 日本語 / 中文)です。

購入後はパッケージ内 Assets/MIDI/documents/ にも同内容が入ります。インストール済みバージョンに合った方を正としてください。本記事は紹介用です。

クイックリンク

Unity 向けプラグインをアセットストアで公開しています。製品名は MIDI Plugin for Mobile and Desktop です。

Unity プロジェクトに MIDI の送受信、SMF の再生・録音、各種トランスポートを追加します。 対象は モバイル・デスクトップ・Unity Editor・WebGL などです。

この記事では概要を紹介します。プラットフォーム対応表や API の詳細は 公開ドキュメント (購入後はパッケージ同梱の同内容)を参照してください。

このプラグインができること / できないこと

できること できないこと(別途必要)
MIDI 入出力・メッセージ配送 内蔵シンセ / SoundFont 再生そのもの
SMF / シーケンサ周辺 DAW 相当のオーディオエンジン代替
Maestro MPTK との任意連携で発音 MPTK の購入必須ではない(音は任意)

Editor や実機で「音」を出したい場合は、例えば Maestro MIDI Player Tool Kit など音源と組み合わせるか、Note On を受け取って自前のオーディオを鳴らしてください。

対応プラットフォーム(要約)

詳細・制限は公開ドキュメントの platforms.md (日本語: i18n/ja/platforms.md) を参照してください。

区分 例
モバイル iOS、Android(Meta Quest 含む)
デスクトップ / Editor Windows、macOS、Linux — Unity Editor の Play Mode 対応
Web WebGL(ブラウザの WebMIDI が許す範囲で USB / BLE)
トランスポート USB MIDI、Bluetooth MIDI (BLE)、Network / RTP-MIDI、Nearby、アプリ間 MIDI(プラットフォーム依存)
プロトコル MIDI 1.0、MIDI 2.0 / UMP(プラットフォーム依存。ドキュメント参照)

過去の記述について: 本記事の初版(2021年)時点ではモバイル向けビルドが中心で、 Unity Editor では動作しませんと書いていました。 v1.3.0 以降は Standalone および Unity Editor(Windows / macOS / Linux) に対応しています。 「Editor では動かない」という断定は現行版には当てはまりません。

インストール

  1. Unity Asset Store からインストールします。
  2. サンプルは Assets/MIDI/Samples/Scenes/ (まずは MidiSampleScene.unity、 または Window → MIDI → Samples)。
  3. Editor での確認: Play Mode に入り、Window → MIDI → Monitor でメッセージを監視できます。
  4. 実機: iOS / Android / Standalone / WebGL / UWP などへ切り替え、ビルドして実デバイスで USB / BLE を確認します。

購入前でも、GitHub 上の スタートガイド と プラットフォーム対応表 を読めます。

推奨 Unity バージョンは Asset Store の表記に従ってください(公開パッケージはおおむね 2022.3 系)。

MidiSampleScene

  • 左: MIDI デバイス選択と送信
  • 右: 受信メッセージ表示

MidiSampleScene — デバイス一覧・送信 UI・受信ログ

初期化は MidiManager.InitializeMidi 周辺にあります。 接続・切断は IMidiDeviceEventHandler、 デバイス名は MidiManager.GetDeviceName (名前未取得時は空のことがあります)。

MIDI デバイスとの接続

Android

  • USB / Bluetooth MIDI は検出・接続され、リストに表示されます(権限・Companion Device はドキュメント参照)。

iOS / macOS

  • Network MIDI や USB / BLE は Core MIDI の挙動に従います。BLE はスキャン時に選択 UI が出ます。

Windows / Linux / WebGL

  • 対応・非対応(例: Windows の BLE MIDI は未対応)は platforms.md を参照してください。

MIDI イベントの送信

MidiManager.Instance.SendMidiNoteOn(
    "deviceId",
    0 /*group*/,
    0 /*channel*/,
    60 /*note*/,
    127 /*velocity*/
);

Fluent API:

using jp.kshoji.unity.midi.util;

MidiSend.ToFirstOutput().Channel(0).NoteOn(60, 127);

MIDI イベントの受信

IMidiNoteOnEventHandler などを実装した MonoBehaviour を MidiManager.Instance.RegisterEventHandleObject(gameObject) で登録し、 InitializeMidi を呼び出します。全文は getting-started.md(日本語) を参照してください(パッケージ同梱版と同一内容です)。

Android ベースの VR(Meta Quest)

Oculus Quest / Meta Quest など Android ベースの VR でも動作します。 VR オブジェクトと実世界の MIDI 機器を相互に反応させられます。 Quest の USB / BLE は ビルド後処理 (GameActivity / Companion Device 含む)の手順に従ってください。

オープンソース

パッケージの一部はオープンソースです。不具合報告・機能要望は supports リポジトリ へどうぞ。

例:

(一覧は contacts.md)

2021年8月14日土曜日

MIDI Plugin for Mobile and Desktop (Unity Asset) — 2026 update

Last updated: 2026-09-27 · Asset version: 2.0.3

MIDI Plugin for Mobile and Desktop — Asset Store cover

MIDI Plugin for Mobile and Desktop (Unity Asset Store)

Documentation (no purchase required): Full manuals are published on the supports repository — start at documents/index.md or the combined PDF/Markdown listed in that README (English / 日本語 / 中文).

After you buy the asset, the same content also ships under Assets/MIDI/documents/ in the package. Prefer whichever copy matches your installed version. This blog post is an introduction only.

Quick links

I publish MIDI Plugin for Mobile and Desktop on the Unity Asset Store. It adds MIDI input/output, SMF play/record, and related transports to Unity projects — on mobile, desktop, Editor, WebGL, and more.

This post introduces the plugin. For platform matrices and APIs, use the public documentation (or the same files inside the package after purchase).

What this plugin is (and is not)

Is Is not
MIDI I/O and message routing A built-in synthesizer / SoundFont player
SMF / sequencer helpers A replacement for DAW audio engines
Optional integration with Maestro MPTK for sound Required to buy MPTK (sound is optional)

If you need audible notes in the Editor or on device, pair this plugin with a sound source (for example Maestro MIDI Player Tool Kit), or drive your own audio from Note On events.

Platforms (summary)

Current support includes (details and caveats in platforms.md):

Area Examples
Mobile iOS, Android (including Meta Quest)
Desktop / Editor Windows, macOS, Linux — Unity Editor Play Mode supported
Web WebGL (USB / BLE via WebMIDI where the browser allows)
Transports USB MIDI, Bluetooth MIDI (BLE), Network / RTP-MIDI, Nearby, Inter-App MIDI (platform-dependent)
Protocols MIDI 1.0, MIDI 2.0 / UMP (platform-dependent; see docs)

Historical note: When this article was first written (2021), the product focused on mobile builds and did not run in the Unity Editor. From v1.3.0 onward, Standalone and Unity Editor (Windows / macOS / Linux) are supported. Please ignore any older statement that “the plugin doesn't work with Unity Editor.”

Install

  1. Install from the Unity Asset Store.
  2. Open a sample under Assets/MIDI/Samples/Scenes/ (start with MidiSampleScene.unity or the sample menu: Window → MIDI → Samples).
  3. For Editor testing: enter Play Mode, then open Window → MIDI → Monitor to watch messages.
  4. For device builds: switch platform (iOS / Android / Standalone / WebGL / UWP), build, and run on hardware when you need real USB/BLE devices.

Before purchasing, you can read the full Getting Started and platform matrix on GitHub.

Recommended Unity: follow the Asset Store listing (currently 2022.3+ lineage for the published package).

MidiSampleScene

The sample shows:

  • Left: device selection and send controls
  • Right: received MIDI messages

MidiSampleScene — device list, send controls, and received MIDI log

Initialization lives around MidiManager.InitializeMidi. Device attach/detach uses IMidiDeviceEventHandler. Device names come from MidiManager.GetDeviceName (may be empty until the name is known).

Connect MIDI devices

Android

  • USB / Bluetooth MIDI devices are discovered and listed (permissions and Companion Device options apply — see docs).

iOS / macOS

  • Network MIDI and USB/BLE follow Apple Core MIDI behavior; BLE selection UI appears when scanning.

Windows / Linux / WebGL

  • See platforms.md for what is ○ / △ / unsupported (e.g. Windows BLE MIDI is not supported yet).

Sending MIDI events

MidiManager.Instance.SendMidiNoteOn(
    "deviceId",
    0 /*group*/,
    0 /*channel*/,
    60 /*note*/,
    127 /*velocity*/
);

Fluent helper:

using jp.kshoji.unity.midi.util;

MidiSend.ToFirstOutput().Channel(0).NoteOn(60, 127);

Receiving MIDI events

Implement handler interfaces (for example IMidiNoteOnEventHandler) on a MonoBehaviour, register with MidiManager.Instance.RegisterEventHandleObject(gameObject), then call InitializeMidi. Full snippets: getting-started.md (same file ships in the package).

VR (Meta Quest)

Android-based headsets such as Meta Quest work with the Android backend. You can drive real MIDI hardware from VR objects and the reverse. For USB MIDI / BLE on Quest, follow Build PostProcessing notes (including GameActivity / Companion Device).

Open source dependencies

Parts of the package rely on open-source libraries (many by the same author). Issue reports and feature requests are welcome on GitHub — start at the supports repository.

Examples:

(Full list: contacts.md.)