@gui-chat-plugin/music
v0.0.2
Published
MusicXML sheet music plugin for GUI Chat
Downloads
319
Readme
@gui-chat-plugin/music
MusicXML sheet music plugin for GUI Chat applications. Displays and plays sheet music from MusicXML format.
Features
- Display sheet music from MusicXML format
- Audio playback with OpenSheetMusicDisplay and osmd-audio-player
- Tempo control
- Cursor following during playback
Installation
yarn add @gui-chat-plugin/musicUsage
Vue Integration
// In src/tools/index.ts
import MusicPlugin from "@gui-chat-plugin/music/vue";
const pluginList = [
// ... other plugins
MusicPlugin,
];
// In src/main.ts
import "@gui-chat-plugin/music/style.css";Core-only Usage
import { executeMusic, TOOL_DEFINITION } from "@gui-chat-plugin/music";
// Show sheet music
const result = await executeMusic(context, {
musicXML: "<musicxml-content>",
title: "My Song",
});API
MusicArgs
interface MusicArgs {
musicXML: string; // The music in MusicXML format
title?: string; // Optional title for the music piece
}MusicToolData
interface MusicToolData {
musicXML: string;
}Dependencies
This plugin requires:
opensheetmusicdisplay: For rendering MusicXML as sheet musicosmd-audio-player: For audio playback
Development
# Install dependencies
yarn install
# Run demo
yarn dev
# Build
yarn build
# Lint
yarn lintTest Prompts
Try these prompts to test the plugin:
- "Create sheet music for a simple C major scale"
- "Write a short melody in G major"
- "Generate sheet music for Twinkle Twinkle Little Star"
License
MIT
