{"id":25443878,"url":"https://github.com/minh711/py-musescore-xml2text","last_synced_at":"2025-07-01T04:35:38.939Z","repository":{"id":277930731,"uuid":"933951069","full_name":"minh711/py-musescore-xml2text","owner":"minh711","description":"This Python tool converts MusicXML files into plain text, extracting key details like tempo, time signature, and key signature for easy AI inquiries.","archived":false,"fork":false,"pushed_at":"2025-02-17T03:02:29.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T04:19:20.243Z","etag":null,"topics":["chatgpt","musescore","music","musicsheet","python","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minh711.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-17T02:51:40.000Z","updated_at":"2025-02-17T03:17:22.000Z","dependencies_parsed_at":"2025-02-17T04:19:23.418Z","dependency_job_id":"0f36dbe8-e669-4e6c-8ce6-571ee628b8bc","html_url":"https://github.com/minh711/py-musescore-xml2text","commit_stats":null,"previous_names":["minh711/py-musescore-xml2text"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minh711%2Fpy-musescore-xml2text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minh711%2Fpy-musescore-xml2text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minh711%2Fpy-musescore-xml2text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minh711%2Fpy-musescore-xml2text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minh711","download_url":"https://codeload.github.com/minh711/py-musescore-xml2text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448632,"owners_count":22072765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","musescore","music","musicsheet","python","utility"],"created_at":"2025-02-17T15:17:34.040Z","updated_at":"2025-05-16T01:09:10.463Z","avatar_url":"https://github.com/minh711.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MusicXML to Text Converter 🎶\n\nFrom **MuseScore**:\n\n![image](https://github.com/user-attachments/assets/1a8aa4ce-b1d0-466a-8f07-0d177d340fec)\n\nThe output after executed:\n\n![image](https://github.com/user-attachments/assets/8128d029-f45a-4eef-b2df-c0a447eed7c2)\n\n## Overview 🌟\n\nThis program was created for musicians, students, or anyone working with **MuseScore** sheet music who wants to easily convert **MusicXML** files into plain text. The goal is to allow you to query AI systems, like **ChatGPT**, about the music even when image inputs are not supported, by providing the music data in a readable, text-based format. 📄🤖\n\nYou may have a sheet of music created in **MuseScore**, but want to ask ChatGPT or another AI system about the music. The problem is that images can't be easily processed in many chat-based AI systems. So, this program converts **MusicXML** (the file format used by MuseScore) into a structured plain text format. This plain text includes key details like tempo, time signature, key signature, clef, and the notes themselves, making it easier to ask AI questions about your music. 🎼💬\n\n---\n\n## Features ✨\n\n- **Tempo**: Extracts the tempo of the piece (e.g., 70 BPM).\n- **Time Signature**: Extracts the time signature, such as \"4/4\".\n- **Key Signature**: Identifies the key of the music, such as \"C Major\", \"D♭ Major\", etc.\n- **Clef**: Detects the clef used in the sheet music (e.g., Treble Clef, Bass Clef).\n- **Notes and Durations**: Lists each note, its pitch, accidental (sharp, flat, natural), octave, and duration (quarter note, eighth note, etc.).\n- **Supports multiple XML files**: If there are multiple XML files in the directory, it allows the user to choose which file to process. 📂🎶\n\n---\n\n## Why Was This Program Created? 🤔\n\nMusic in digital sheet music form (e.g., MuseScore) is often stored as **MusicXML** files. However, many AI models, including **ChatGPT**, do not support the direct input of images. If you want to discuss specific aspects of the music (such as key signature, tempo, or notes) but have the music only in sheet music form, it can be difficult to describe the music fully.\n\nThis program allows you to convert **MusicXML** files (the format used by MuseScore) into **plain text**. This text-based format is something you can easily share with an AI system to ask about specific musical details, patterns, or insights. 🎤💡\n\n---\n\n## Installation ⚙️\n\n### Requirements 📝\n\n- **Python 3.x** (You can check your Python version by running `python --version` in the terminal).\n- **MuseScore MusicXML files** (`.xml` format).\n\n### Steps 🏗️\n\n1. **Download the Script**: Clone or download the repository containing the Python script `main.py`.\n\n2. **Install Python**: Ensure that **Python 3.x** is installed on your system. You can download it from [python.org](https://www.python.org/downloads/).\n\n3. **Download MuseScore** (if you don't already have it): MuseScore is a free music notation software. You can download it from [MuseScore's official website](https://musescore.org/).\n\n4. **Ensure MusicXML Files**: You need **MusicXML** files generated from **MuseScore**. If you have sheet music in MuseScore, you can export it to MusicXML format by selecting `File` → `Export` and choosing `.xml` as the format.\n\n---\n\n## How to Use 🚀\n\n### 1. **Prepare Your XML Files** 📂\n\nMake sure you have your **MusicXML** files ready in the same directory as the script. The file extension should be `.xml`. If you have multiple files, the program will list them for you to choose from.\n\n### 2. **Run the Program** ▶️\n\nJust run the `run.bat` file by double-clicking it, then follow the instructions in the terminal window.\n\n### 3. **Select Your XML File** 📝\n\nIf there are multiple `.xml` files in the directory, the program will prompt you to choose one. You will see a list of available files, like:\n\n```txt\nAvailable XML files:\n\n1. example1.xml\n2. example2.xml\n3. example3.xml\n```\n\nSimply enter the number corresponding to the file you want to process. ✨\n\n### 4. **Check the Output** 📥\n\nAfter running the script, an output text file will be created. The file will have the same name as the chosen XML file, but with the `.txt` extension (e.g., `example1.txt`).\n\nOpen this text file to see details like:\n\n- Tempo 🕰️\n- Time Signature 📝\n- Key Signature 🎶\n- Clef 🎼\n- Notes and their durations 🎵\n\nExample output:\n\n```txt\nTempo: 70 BPM\nTime Signature: 4/4\nKey Signature: D♭ Major\nClef: G Clef\n\nMeasure 1: D♭4 (Quarter, 240), E♭4 (Quarter, 240)\nMeasure 2: F4 (Quarter, 240), G4 (Quarter, 240)\n...\n```\n\n### 5. **Ask AI Questions** 💬\n\nNow that you have the music in a readable text format, you can copy and paste it into an AI model like **ChatGPT** and ask about specific aspects of the music.\n\n---\n\n## Example Use Cases 💡\n\n1. **Ask about the Key Signature**: \"What is the key of the music in the output text?\"\n2. **Ask about the Tempo**: \"What is the tempo of the music in the output text?\"\n3. **Ask about Notes**: \"What are the notes in the second measure of the music?\"\n\n---\n\n## Additional Notes 🔍\n\n- The program is designed to read **MusicXML** files, which is a widely used format for storing music notation data.\n- If the XML file doesn't contain a specific piece of information (such as a key signature or tempo), it will return \"Unknown\" in the output.\n\n---\n\n## Troubleshooting ⚠️\n\n- **No XML Files Found**: Make sure your MusicXML files are in the same directory as the script. The program only works with `.xml` files generated by MuseScore.\n- **UnicodeEncodeError**: If you encounter an error when writing to the text file (such as with special characters like ♯ or ♭), ensure your system supports UTF-8 encoding. You can try opening the file in a text editor that supports Unicode.\n\n---\n\n## Conclusion 🎉\n\nThis tool provides an easy way to convert **MuseScore MusicXML** files into a text-based format that can be processed and queried by AI systems. With it, you can convert your sheet music into a format that is easy to analyze and discuss with AI models like **ChatGPT**! 🤖🎶\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminh711%2Fpy-musescore-xml2text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminh711%2Fpy-musescore-xml2text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminh711%2Fpy-musescore-xml2text/lists"}