Notematic Player Lite
Notematic Player Lite 是一个 100% 原版的 Minecraft Java 版数据包,旨在作为 Notematic Studio 的轻量级伴生播放模组。它可以在世界内直接向玩家播放自定义音符盒音乐序列以及文本转语音的合成音频。该模组完全基于原版 Minecraft 函数、NBT 存储和宏命令编写,运行需要 零服务器插件、模组或资源包,因此非常适合用于单人世界、Minecraft Realms 或纯原版服务器。
功能特性
- 100% 原版 & 服务端运行: 在纯原版 Minecraft 上运行。无需任何插件(如 Paper/Spigot)或客户端模组。
- Notematic Studio 伴生支持: 播放直接从 Notematic Studio MIDI 转换器和声码器导出的
.mcfunction 乐谱。
- 全局声音广播: 使用
/playsound 直接向玩家广播音频,使其在世界中的任何位置都能清晰听到音乐。
- NBT 驱动播放引擎: 利用 Minecraft 存储和宏函数 (
$(instrument), $(note)) 动态触发具有正确音调和音量的声音。
- 速度控制: 从乐谱中读取自定义的速度缩放值,以动态加速或减速播放。
- 静音跳过: 自动检测并跳过歌曲开头的静音部分,实现即时开始播放。
- 语音合成支持: 完全支持播放由 Notematic Studio 生成的合成语音音符盒序列。
[!NOTE]
正在寻找带有定位音频、每位玩家的独立音量控制、离线同步和 .json 文件夹扫描功能的完整版服务器插件?请查看 Spigot/Paper 上的 Notematic Player Plugin。
数据包函数
由于 Notematic Player Lite 是一个数据包,控制命令需使用原版 /function 命令运行:
| 函数命令 |
简短描述 |
/function notematic_lite:songs/<song_name> |
播放捆绑曲库中的特定歌曲。 |
/function notematic_lite:stop |
停止当前播放并清除计划的循环执行。 |
/function notematic_lite:setup |
手动运行初始化设置并打印状态确认信息。 |
添加自定义歌曲与语音
要添加您自己的自定义音乐或文本转语音文件:
- 使用 Notematic Studio 转换您的 MIDI 文件或生成合成语音。
- 将歌曲导出/下载为
.mcfunction 文件。
- 将
.mcfunction 文件保存在您的世界目录中,路径如下:
saves/<World Name>/datapacks/Notematic Player Lite/data/notematic_lite/function/songs/
- 在 Minecraft 中运行
/reload 命令。
- 在游戏中通过
/function notematic_lite:songs/<song_name> 播放歌曲。
音乐文件格式与技术规格 (.mcfunction)
每个歌曲文件都是一个简单的 .mcfunction 脚本,用于向 NBT 存储填充歌曲数据并触发播放器:
# Generated by Notematic Studio
data modify storage notematic_lite sheet set value {"tempo":1,"notes":[{"instrument":"harp","note":1.4142,"when":0},{"instrument":"bass","note":0.7071,"when":5}]}
# Play the song
function notematic_lite:play
NBT 存储结构:
tempo: 速度倍率(双精度浮点数)。1 表示标准刻速度播放。
notes: 按 when 时间顺序排序的音符事件数组。
instrument: 乐器名称(例如 harp、piano、bass、bell、flute、guitar、pling、bit、banjo)。也可以是任何游戏内的 /playsound 标识符(例如 minecraft:entity.cow.ambient、minecraft:block.bell.use 或自定义资源包声音)。
note: 音调乘数,范围从 0.5 到 2.0。
volume: (可选)特定于音符的音量,范围从 0.0 到 1.0。
when: 相对于歌曲开始的刻延迟。
开发者 / 数据包集成 API
其他数据包可以轻松与 Notematic Player Lite 接口,以编程方式播放音乐(例如,用于自定义冒险地图事件、大厅音乐或小游戏)。
播放歌曲
要动态播放歌曲,请将乐谱 JSON 写入 notematic_lite 存储并调用 play 函数:
# Load the music data into storage
data modify storage notematic_lite sheet set value {tempo:1, notes:[{instrument:"harp", note:1.0, when:0}]}
# Trigger the playback engine on the player executing the function
function notematic_lite:play
停止播放
要从另一个数据包停止任何活动播放:
function notematic_lite:stop
Notematic Player Lite
Notematic Player Lite is a 100% vanilla Minecraft Java Edition datapack designed as the lightweight companion player for Notematic Studio. It plays custom note block music sequences and text-to-speech vocoded audio directly to players in the world. Written entirely with vanilla Minecraft functions, NBT storage, and macro commands, it requires zero server plugins, mods, or resource packs to function, making it ideal for Singleplayer worlds, Minecraft Realms, or purely vanilla servers.
Features
- 100% Vanilla & Server-Side: Runs on pure vanilla Minecraft. No plugins (like Paper/Spigot) or client-side mods required.
- Notematic Studio Companion: Plays
.mcfunction song sheets exported directly from the Notematic Studio MIDI converter and Vocoder.
- Global Sound Broadcast: Broadcasts audio directly to players using
/playsound so they can hear the music clearly from anywhere in the world.
- NBT-Driven Playback Engine: Utilizes Minecraft storage and macro functions (
$(instrument), $(note)) to dynamically trigger sounds with correct pitches and volumes.
- Tempo Control: Reads custom tempo scaling values from the song sheet to dynamically speed up or slow down playbacks.
- Silence Skipping: Automatically detects and skips leading silence at the start of a song, starting playback instantly.
- Speech Vocoding Support: Fully supports playing vocoded speech note block sequences generated by Notematic Studio.
[!NOTE]
Looking for the full-featured server plugin version with positional audio, per-player personal volume controls, offline synchronization, and .json folder scanning? Check out the Spigot/Paper Notematic Player Plugin.
Datapack Functions
Since Notematic Player Lite is a datapack, control commands are run using the vanilla /function command:
| Function Command |
Short Description |
/function notematic_lite:songs/<song_name> |
Plays a specific song from the bundled song library. |
/function notematic_lite:stop |
Stops the active playback and clears scheduled loop executions. |
/function notematic_lite:setup |
Manually runs the initialization setup and prints status confirmation. |
Adding Custom Songs & Speech
To add your own custom music or vocoded text-to-speech files:
- Convert your MIDI files or generate vocoded speech using Notematic Studio.
- Export/download the song as a
.mcfunction file.
- Save the
.mcfunction file in your world directory at:
saves/<World Name>/datapacks/Notematic Player Lite/data/notematic_lite/function/songs/
- Run the
/reload command in Minecraft.
- Play the song in-game with
/function notematic_lite:songs/<song_name>.
Music File Formats & Technical Specification (.mcfunction)
Each song file is a simple .mcfunction script that populates the NBT storage with song data and triggers the player:
# Generated by Notematic Studio
data modify storage notematic_lite sheet set value {"tempo":1,"notes":[{"instrument":"harp","note":1.4142,"when":0},{"instrument":"bass","note":0.7071,"when":5}]}
# Play the song
function notematic_lite:play
NBT Storage Structure:
tempo: Tempo speed multiplier (double). 1 plays at standard tick speed.
notes: An array of note events, sorted chronologically by when.
instrument: Name of the instrument (e.g. harp, piano, bass, bell, flute, guitar, pling, bit, banjo). Can also be any in-game /playsound identifier (e.g., minecraft:entity.cow.ambient, minecraft:block.bell.use, or custom resource pack sounds).
note: The pitch multiplier from 0.5 to 2.0.
volume: (Optional) Note-specific volume from 0.0 to 1.0.
when: The tick delay relative to the start of the song.
Developer / Datapack Integration API
Other datapacks can easily interface with Notematic Player Lite to play music programmatically (e.g., for custom adventure map events, lobby music, or minigames).
Playing a Song
To play a song dynamically, write the song sheet JSON into the notematic_lite storage and call the play function:
# Load the music data into storage
data modify storage notematic_lite sheet set value {tempo:1, notes:[{instrument:"harp", note:1.0, when:0}]}
# Trigger the playback engine on the player executing the function
function notematic_lite:play
Stopping Playback
To stop any active playback from another datapack:
function notematic_lite:stop
评论 0
登录后参与评分
还没有评论,来抢沙发吧