A MuseScore-like web-based music notation editor with AI-powered composition assistance.
- Music Notation Display: View and edit music scores using OpenSheetMusicDisplay
- File Support: Open MuseScore (.mscz), MusicXML (.musicxml, .mxl, .xml) files
- MIDI-like Playback: Listen to your compositions with Tone.js synthesis
- AI Assistant: Chat with an LLM (via OpenRouter) to modify and create music using natural language
- Score Creation: Create new scores with custom instruments, key signatures, and time signatures
- Export: Save your work as MusicXML files
- Node.js (v14 or higher)
- npm
- Clone the repository:
git clone https://github.com/yourusername/CounterpointAI.git
cd CounterpointAI- Install dependencies:
npm install- Start the server:
npm start- Open your browser and navigate to
http://localhost:3000
To use the AI assistant features, you'll need an OpenRouter API key:
- Sign up at OpenRouter
- Create an API key
- Enter your API key in the chat panel of the application
Supported models:
- Claude 3.5 Sonnet (default)
- Claude 3 Haiku
- GPT-4o
- GPT-4o Mini
- Gemini Pro 1.5
- Click the folder icon or press
Ctrl+Oto open a file - Supported formats: .mscz, .musicxml, .mxl, .xml
- Click the new file icon or press
Ctrl+N - Configure title, composer, key signature, time signature, and instruments
- Click "Create Score"
- Use the note palette on the left to select note durations
- Click on the score to add notes (basic editing)
- Use keyboard shortcuts:
1-5: Select note duration (whole to sixteenth)Arrow Up/Down: Transpose selected noteDelete/Backspace: Delete selected noteCtrl+Z: UndoCtrl+YorCtrl+Shift+Z: Redo
- Click the play button or press
Spaceto play/pause - Adjust tempo with the BPM input
- Control volume with the slider
- Use the timeline to seek through the score
- Enable loop mode for continuous playback
Chat with the AI to modify your music:
Example prompts:
- "Add a bass line to accompany the melody"
- "Transpose the score up a major third"
- "Add a countermelody in the style of Bach"
- "Fill measures 5-8 with a rhythmic variation"
- "Harmonize this melody in a classical style"
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Music Rendering: OpenSheetMusicDisplay (OSMD)
- Audio Synthesis: Tone.js
- File Handling: JSZip (for compressed formats)
- Backend: Express.js
- AI Integration: OpenRouter API
CounterpointAI/
├── public/
│ ├── css/
│ │ └── styles.css
│ ├── js/
│ │ ├── app.js
│ │ ├── score-editor.js
│ │ ├── playback-engine.js
│ │ ├── ai-assistant.js
│ │ └── musicxml-generator.js
│ └── index.html
├── uploads/
├── server.js
├── package.json
└── README.md
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
- OpenSheetMusicDisplay for music notation rendering
- Tone.js for audio synthesis
- OpenRouter for LLM API access