PartyKeys MIDI 键盘控制
name: partykeys_midi
by allen4z · published 2026-04-01
$ claw add gh:allen4z/allen4z-partykeys-midi---
name: partykeys_midi
description: "Control PartyKeys MIDI keyboard via BLE - connect device, light up keys, listen to playing, play sequences, and follow mode for music teaching. Use when user mentions: MIDI keyboard, PartyKeys, 音乐密码, light up keys, 点亮按键, listen to playing, 监听弹奏, music hardware control."
metadata: {"openclaw": {"requires": {"bins": ["python3"]}, "os": ["darwin", "linux"]}}
---
# PartyKeys MIDI 键盘控制
通过 MCP 控制 PartyKeys MIDI 键盘(音乐密码)的 LED 灯光和监听弹奏。
安装
首次使用前运行安装脚本:
bash {baseDir}/scripts/setup.sh脚本会自动创建 Python 虚拟环境、安装依赖,并将 MCP 服务器配置注册到 OpenClaw。
可用工具
music_connect
连接 MIDI 键盘设备。
参数:
Script 模式自动扫描并连接,无需浏览器。
Web 模式启动 Gateway Server (http://localhost:9527),需在 Chromium 浏览器中操作。
music_disconnect
断开设备连接。
music_light_keys
点亮指定按键的 LED 灯。
参数:
music_listen
监听用户弹奏输入。
参数:
music_play_sequence
播放音符序列(仅 script 模式)。
参数:
music_follow_mode
跟弹模式 — 点亮音符并等待用户弹奏正确后继续(仅 script 模式)。
参数:
music_status
获取硬件连接状态,无参数。
使用流程
1. **连接设备**: 调用 `music_connect`(推荐 `mode="script"`)
2. **执行操作**: 点亮按键、播放序列或监听弹奏
3. **断开连接**: 调用 `music_disconnect`
示例
**教学模式**:
music_connect(mode="script")
music_light_keys(keys=["C4", "E4", "G4"], color="blue")
music_follow_mode(notes=["C4", "E4", "G4"], timeout=30000)
music_disconnect()**演示模式**:
music_connect(mode="script")
music_play_sequence(sequence=[
{"keys": ["C4"], "delay": 500},
{"keys": ["E4"], "delay": 500},
{"keys": ["G4"], "delay": 500}
])
music_disconnect()架构
AI Agent (OpenClaw)
↓ MCP Protocol (stdio)
MCP Server (Python, {baseDir}/server/mcp_server.py)
├─ Script 模式 → BLE (bleak) → MIDI 键盘
└─ Web 模式 → HTTP → Gateway (Node.js:9527) → WebSocket → Browser (Web Bluetooth) → BLE → MIDI 键盘故障排查
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...