AltitudeVolume -高さ・ゾーン音量調整-【UDON Sharp】
- Digital600 JPY

Altitude Volume System は、プレイヤーの高さとゾーン位置に応じて環境音とゾーン固有オーディオの音量を自動制御する UdonSharp コンポーネント群です。 距離ブレンド対応のゾーン、優先度合成、スムーズなフェード、無音時の自動停止まで含み、軽量・直感・破綻のないサウンド遷移を実現します。 The Altitude Volume System is a set of UdonSharp components that automatically controls the volume of ambient and zone-specific audio based on player height and zone location. It delivers lightweight, intuitive, and seamless sound transitions, including distance-blending zones, priority synthesis, smooth fades, and even auto-stop on silence.
機能/Function
◆高さによる音量変化 全体音量をワールド座標の X/Y/Z いずれかを“高さ”によって音量を変化させます。 「地面→空」だけでなく、横方向の進行や奥行きの移動にも連動。 ガンマカーブで立ち上がりを簡単かつ自然に設定できます。 ◆ゾーンと境界“距離ブレンド” 全体音量を「ゾーン」内でオーバーライドできます。ゾーンに入るとスッと馴染む“空間的フェード”を搭載しています。 2つの方法で広い屋外→室内、洞窟、区画ごとの音の空気感を直感的に表現します。 ・時間によるフェードにはトロコイド曲線でより自然な遷移。 ・ゾーンの境界線から 内側/外側 ブレンド帯を設定し、プレイヤー位置によって音量遷移が変化。 ◆ゾーン専用オーディオ ゾーンに入ると設定した別のBGM/環境音を自動再生、ゾーンから出ると停止します。 ゾーンだけを使う設定も可能です。 ◆AudioSourceの音量を“上書き”か“係数”かを選べる 各 AudioSource の元のボリュームバランスを保ったまま、全体だけをダイナミックにコントロールできます。 ◆ツールチップと言語対応 詳細はインスペクターのツールチップに記載しています。 また、全てのインスペクターは日本語と英語に対応しています。 ◆ Height-Based Volume Dynamically adjust the master volume by “height” along any world axis (X, Y, or Z). It reacts not only to ground → sky movement, but also to lateral and depth movement. A gamma curve makes it easy to shape a smooth, natural ramp-in. ◆ Zone & Boundary “Distance Blend” Override the master volume inside a defined “Zone.” A built-in spatial fade lets audio ease in seamlessly as you enter. Express outdoor → indoor shifts, caves, or per-section ambience with two methods: ・Time-based fades using a trochoid curve for more lifelike transitions. ・Distance-to-boundary blending: set inner/outer blend bands from the zone edge so the volume transition responds to player position. ◆ Zone-Specific Audio Automatically play designated background music (BGM) or ambience when entering a Zone, and stop it on exit. You can also use Zones on their own. ◆ Choose “Override” or “Multiplier” per AudioSource Keep each AudioSource’s original mix intact while dynamically controlling only the global level. ◆ Tooltips & Localization Detailed explanations are provided in the Inspector tooltips. All Inspectors are fully localized in Japanese and English.
詳細/Detail
◆高さ→音量マッピング ・下端の座標/上端の座標 と 下端の音量/上端の音量、下端と上端の間をガンマ(responseGamma)で音量を定義。 ・マッピング対象はローカルのHeadまたはRoot位置を選択可能。 ・AuidoSourceは複数設定可 ◆ゾーン制御(複数コライダー対応) ・全体音量に対してゾーンの中に入るとオーバーライドをします。 ・Box/Sphere コライダーを複数指定して一塊に。別々のゾーンが重なるときは1つを条件から選択。 ・全体音量に対する合成モード:Replace(上書き) / Multiply(係数) / Min (比較)/ Max (比較) 合成モードによっては全体音量の高さ音量マッピングも同時に反映します。 ◆境界“距離ブレンド” ・ゾーンに入ると全体音量をゾーンの設定にオーバーライドし、通常は時間フェードで音量を変化させます。 ・ゾーン用のトリガーの境界から内側/外側指定(m)し、ブレンド帯作成。ブレンド帯ではの位置により線形遷移。 ・ブレンド帯の可視化 Gizmo(外枠/内枠)付き。 ◆ゾーン固有オーディオ(targetZoneAudio) ・ゾーンに入った時だけ再生し、ゾーンから出ると停止します。 ・時間フェードと同時に境界距離ブレンドを同時に適応します。 ◆環境音(コントローラ)側の遷移 ・ゾーン未使用時は高さだけで制御。 ・距離ONのゾーンが有効な間は空間ブレンドを採用、時間フェードは自動無効化。 ・距離OFFの場合は zoneTimeFade による時間固定トロコイドで in/out をブレンド。 ◆ミュート ・コントローラとゾーンの音量をミュートする機能。uGUIを想定しています。 ・トグルの設定例プレハブを用意しています。 ◆無音時の自動停止 ・音量がほぼ0になった時にはAudioSourceを停止します。設定から音量0でも再生を継続可能。 ◆チューニングと安定性 ・音量は小数第3位で丸め(0.001刻み)。 ・高さの測定と音量の更新は固定刻み(10Hz)で変更可能です。 # Height → Volume Mapping * Define lower/upper coordinates and lower/upper volumes; volumes in between are shaped by a gamma curve (`responseGamma`). * Mapping target can use the local **Head** or **Root** position. * Supports assigning multiple **AudioSources**. # Zone Control (Multi-Collider) * Overrides the global volume while the player is inside a Zone. * Combine multiple **Box/Sphere** colliders into one Zone; when separate Zones overlap, choose one according to your selection rules. * Blend modes against the global volume: **Replace** (override) / **Multiply** (factor) / **Min** (compare) / **Max** (compare). Depending on the mode, the global height→volume mapping can be applied simultaneously. # Boundary “Distance Blend” * On entering a Zone, the Zone’s settings override the global volume; by default, level changes with a time-based fade. * From the Zone’s trigger boundary, set **inner/outer distances (m)** to create blend bands; within the band, volume transitions linearly with player position. * Includes Gizmos to visualize the outer/inner blend frames. # Zone-Specific Audio (`targetZoneAudio`) * Plays only while inside the Zone and stops on exit. * Applies boundary **Distance Blend** together with the time fade. # Controller-Side Transitions (Ambient Controller) * **No Zones:** height-only control. * **Zones with Distance Blend = ON:** uses spatial (distance) blending; time fade is auto-disabled. * **Distance Blend = OFF:** blends in/out using `zoneTimeFade` with a time-fixed **trochoid** curve. # Mute * Mute controls for both the Controller and individual Zones (designed for **uGUI**). * Includes an example prefab with toggle setup. # Auto Stop on Silence * Stops **AudioSources** when volume is effectively zero; optionally continue playback at volume 0 via settings. # Tuning & Stability * Volume is rounded to three decimals (0.001 steps). * Height sampling and volume updates run at a fixed tick (**10 Hz**), and are configurable.
開発環境/Operating
Unity 20223.22f1 VRCSDK 3.8.2
アップデート履歴/Update
[2025 09 19: V1.0.0] 販売開始
ライセンス/Lisence
# Universal Tool Asset License (UTAL) (ツール資産汎用ライセンス/日本語・英語併記) Version: v1.0 Effective Date: 2025-09-17 Licensor(ライセンサー/提供者): Oguro Kou (a.k.a. Ryuban) Product(製品名): AltitudeVolume --- 日本語(JA) 1. 定義 「本資産」: 本製品を構成するエディタ拡張、スクリプト(C#等)、プレハブ、シェーダー、テクスチャ、アイコン、サンプル、ドキュメントその他一切をいいます。 「ユーザー」: 本契約に基づき許諾を受ける個人または法人をいいます。 「埋め込み配布」: 本資産を抽出できない形(ビルド、バンドル、ベイク、アセットバンドル化等)で最終成果物に組み込み配布することをいいます。 「席(Seat)」: エディタ機能を使用する個人ユーザー1名分の利用枠をいいます。 2. 許諾 ライセンサーはユーザーに対し、非独占的・譲渡不可・サブライセンス不可の権利として、以下の範囲で本資産の利用を許諾します。 1. ユーザーのプロジェクトにおける本資産のインストール、複製、改変(内部利用の範囲)。 2. VRChatワールド等のコンテンツ制作への利用。 3. 最終成果物への埋め込み配布(抽出不可の状態に限る)。 4. VRChat上での公開(Public化を含む)。 3. 禁止事項(再配布NG/同梱NG) ユーザーは、以下を行ってはなりません。 * 本資産またはその改変物の再配布・再販売・公開(例: unitypackage、.prefab、.cs、.shader、テンプレート、ツール/ライブラリ化、他アセットへの同梱配布)。 * 第三者が抽出可能な形での配布や、ソース形式での配布。 * 席の共有・貸与・共同購入の分配等、実質的に無制限利用を許す行為。 * 本資産の一部を素材集として転用・頒布する行為。 4. 席数とインストール * 本資産のエディタ機能は、2席まで使用できます(1席=1名)。 * 個人ユーザーは同一人物に限り、最大2台までインストール可。 * 法人利用はユーザー数分の席が必要です。継続的なCI/ビルドサーバーでの使用は、担当者数に応じた席または別途合意が必要です。 5. 外部委託 * 制作委託先は、ユーザーの管理下で本資産を利用できます。 * 委託終了時、委託先は本資産の全コピーを消去し、再利用を行ってはなりません。 6. 第三者資産 * 本資産に第三者コンポーネントが含まれる場合、当該コンポーネントのライセンスが適用されます。 * それらの条件が本契約と抵触する場合、当該部分については第三者ライセンスが優先します。 7. 知的財産 * 本資産に関する全ての権利はライセンサーに帰属します。本契約は権利の譲渡を意味しません。 8. 免責 * 本資産は現状有姿(AS IS)で提供され、明示黙示のいかなる保証も行いません。 9. 責任制限 * 法律上許される最大限の範囲で、ライセンサーの責任は、ユーザーが本資産に対して実際に支払った金額を上限とします。間接損害・特別損害等については責任を負いません。 10. 期間・終了 * ユーザーが本契約に違反した場合、許諾は直ちに終了します。終了時、ユーザーは本資産の全コピーを削除しなければなりません。 11. 準拠法・管轄 * 本契約は日本国の法に準拠します。紛争は大阪地方裁判所を専属的合意管轄裁判所とします。 12. その他 * 本契約は本資産に関する当事者間の完全な合意を構成します。ライセンサーは合理的な範囲で本契約を更新することができます。 * クレジット表記は必須ではありません(任意)。 --- English (EN) 1. Definitions “Assets”: All components of the Product, including editor extensions, scripts (e.g., C#), prefabs, shaders, textures, icons, samples, and documentation. “User”: The individual or entity licensed under this Agreement. “Embedded Distribution”: Distribution of the Assets only in a non‑extractable form (e.g., built, bundled, baked, asset‑bundled) within an end product. “Seat”: One named individual’s right to use the editor functionality. 2. Grant of License Licensor grants User a non‑exclusive, non‑transferable, non‑sublicensable license to: 1. install, copy, and modify the Assets for **internal use** within User’s projects; 2. use the Assets to create VRChat worlds and similar content; 3. perform Embedded Distribution of end products only when the Assets are not extractable; 4. publish such worlds on VRChat, including **Public** release. 3. Restrictions (No Redistribution / No Bundling) User shall not: * redistribute, resell, or publish the Assets or any derivatives as Assets (e.g., unitypackage, .prefab, .cs, .shader), including use as templates, tools, libraries, or bundling within other asset products; * distribute the Assets in a form that is extractable or in source form; * share seats, lend, or pool purchases in a way that enables effectively unlimited use by third parties; * repurpose parts of the Assets as stock materials or collections. 4. Seats & Installation * Editor functionality may be used by up to 2 seat(s) (1 seat = 1 person). * An individual user may install on up to two devices provided both are used by the same person. * Organization use requires one seat per user. Persistent CI/build‑server use requires seats matching the number of maintainers or a separate agreement. 5. Contractors * Contractors may use the Assets under User’s control solely for User’s projects. * Upon completion, contractors must delete all copies and must not reuse the Assets for other clients. 6. Third‑Party Components * If third‑party components are included, their respective licenses apply. In case of conflict, the third‑party license prevails for that component. 7. IP Ownership * All rights in and to the Assets remain with the Licensor. No ownership is transferred under this Agreement. 8. Disclaimer * The Assets are provided “AS IS”, without warranties of any kind, express or implied. 9. Limitation of Liability * To the maximum extent permitted by law, Licensor’s total liability is limited to the amount actually paid for the Assets. Licensor shall not be liable for indirect, special, or consequential damages. 10. Term & Termination * Any breach of this Agreement immediately **terminates** the license. Upon termination, User must delete all copies of the Assets. 11. Governing Law & Venue * This Agreement is governed by the laws of Japan. The Osaka District Court shall have exclusive jurisdiction. 12. Miscellaneous * This Agreement constitutes the entire agreement with respect to the Assets. Licensor may update this Agreement with reasonable notice. * Attribution is not required (optional). ---