# Musical MIDI Generator
A Python-based MIDI melody generator that creates musical compositions across different genres with sophisticated chord progressions, melodic patterns, and basslines.
## Features
- Multiple genre support including:
- Pop/Rock
- Jazz
- Blues
- Latin
- Folk/Acoustic
- Electronic
- Epic/Film Score
- R&B/Soul
- Intelligent chord progression generation based on genre
- Dynamic melody creation with genre-specific patterns
- Accompanying bassline generation
- Support for different musical keys
- Multi-track MIDI output (melody, chords, and bass)
- Genre-appropriate rhythmic patterns
- Verse and chorus section generation
## Installation
You can install this package in two ways:
### 1. Using pip (Recommended)
```bash
pip install --index-url https://maven.pkg.github.com/JDCurry/midi-melody-generator/ midimelody
```
### 2. From source
```bash
git clone https://github.com/JDCurry/midi-melody-generator.git
cd midi-melody-generator
pip install -e .
```
## Usage
### As a Python Package
```python
from midimelody import generate_midi
# Generate a new MIDI composition
generate_midi()
```
### From Command Line
If installed from source, you can run directly:
```bash
python melody_generator.py
```
Follow the interactive prompts to:
1. Select a musical key (C, C#/Db, D, etc.)
2. Choose a genre
3. The program will generate a MIDI file with a unique name in your current directory
## How It Works
The generator creates music in three layers:
1. **Chord Progression**: Genre-specific chord progressions that form the harmonic foundation
2. **Melody**: Intelligent melody generation that follows chord tones and scale degrees
3. **Bassline**: Complementary bass patterns that match the genre and harmony
Each genre has its own characteristics:
- Pop/Rock: Standard chord progressions with catchy melodic patterns
- Jazz: Sophisticated harmony with extended chords
- Blues: Traditional 12-bar patterns with blue notes
- Latin: Syncopated rhythms and specific harmonic movements
- Folk: Simple, traditional progressions
- Electronic: Modern, repetitive patterns
- Epic/Film Score: Dramatic progressions and wide melodic ranges
- R&B/Soul: Soulful progressions with rhythmic emphasis
## Development
### Setting up for development
1. Clone the repository:
```bash
git clone https://github.com/JDCurry/midi-melody-generator.git
cd midi-melody-generator
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install development dependencies:
```bash
pip install -e ".[dev]"
```
### Running Tests
```bash
python -m unittest tests/test_generator.py
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
### Areas for Improvement
- Additional genres and sub-genres
- More sophisticated rhythm generation
- User interface improvements
- Additional instrument tracks
- Custom tempo support
- Scale mode options (minor, dorian, etc.)
- MIDI file naming conventions
- Export options for different file formats
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- Built using the [Mido](https://mido.readthedocs.io/) library for MIDI file handling
- Inspired by music theory and common chord progressions across different genres
---
# LICENSE
MIT License
Copyright (c) 2025 JD Curry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
# .gitignore
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Generated MIDI files
*.mid
# Virtual Environment
venv/
ENV/
# IDE
.idea/
.vscode/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
Raw data
{
"_id": null,
"home_page": "https://github.com/JDCurry/midi-melody-generator",
"name": "midimelody",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "midi, music, generator, melody, composition",
"author": "JD Curry",
"author_email": "jdcurry@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/0d/91/4e96c7a8de4829b05cba5244e757d136a9992c9685265bb955f8912b5eed/midimelody-0.1.1.tar.gz",
"platform": null,
"description": "# Musical MIDI Generator\n\nA Python-based MIDI melody generator that creates musical compositions across different genres with sophisticated chord progressions, melodic patterns, and basslines.\n\n## Features\n\n- Multiple genre support including:\n - Pop/Rock\n - Jazz\n - Blues\n - Latin\n - Folk/Acoustic\n - Electronic\n - Epic/Film Score\n - R&B/Soul\n- Intelligent chord progression generation based on genre\n- Dynamic melody creation with genre-specific patterns\n- Accompanying bassline generation\n- Support for different musical keys\n- Multi-track MIDI output (melody, chords, and bass)\n- Genre-appropriate rhythmic patterns\n- Verse and chorus section generation\n\n## Installation\n\nYou can install this package in two ways:\n\n### 1. Using pip (Recommended)\n```bash\npip install --index-url https://maven.pkg.github.com/JDCurry/midi-melody-generator/ midimelody\n```\n\n### 2. From source\n```bash\ngit clone https://github.com/JDCurry/midi-melody-generator.git\ncd midi-melody-generator\npip install -e .\n```\n\n## Usage\n\n### As a Python Package\n```python\nfrom midimelody import generate_midi\n\n# Generate a new MIDI composition\ngenerate_midi()\n```\n\n### From Command Line\nIf installed from source, you can run directly:\n```bash\npython melody_generator.py\n```\n\nFollow the interactive prompts to:\n1. Select a musical key (C, C#/Db, D, etc.)\n2. Choose a genre\n3. The program will generate a MIDI file with a unique name in your current directory\n\n## How It Works\n\nThe generator creates music in three layers:\n\n1. **Chord Progression**: Genre-specific chord progressions that form the harmonic foundation\n2. **Melody**: Intelligent melody generation that follows chord tones and scale degrees\n3. **Bassline**: Complementary bass patterns that match the genre and harmony\n\nEach genre has its own characteristics:\n- Pop/Rock: Standard chord progressions with catchy melodic patterns\n- Jazz: Sophisticated harmony with extended chords\n- Blues: Traditional 12-bar patterns with blue notes\n- Latin: Syncopated rhythms and specific harmonic movements\n- Folk: Simple, traditional progressions\n- Electronic: Modern, repetitive patterns\n- Epic/Film Score: Dramatic progressions and wide melodic ranges\n- R&B/Soul: Soulful progressions with rhythmic emphasis\n\n## Development\n\n### Setting up for development\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/JDCurry/midi-melody-generator.git\ncd midi-melody-generator\n```\n\n2. Create a virtual environment:\n```bash\npython -m venv venv\nsource venv/bin/activate # On Windows: venv\\Scripts\\activate\n```\n\n3. Install development dependencies:\n```bash\npip install -e \".[dev]\"\n```\n\n### Running Tests\n```bash\npython -m unittest tests/test_generator.py\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n### Areas for Improvement\n\n- Additional genres and sub-genres\n- More sophisticated rhythm generation\n- User interface improvements\n- Additional instrument tracks\n- Custom tempo support\n- Scale mode options (minor, dorian, etc.)\n- MIDI file naming conventions\n- Export options for different file formats\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built using the [Mido](https://mido.readthedocs.io/) library for MIDI file handling\n- Inspired by music theory and common chord progressions across different genres\n\n---\n\n# LICENSE\n\nMIT License\n\nCopyright (c) 2025 JD Curry\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\n# .gitignore\n\n# Python\n__pycache__/\n*.py[cod]\n*$py.class\n*.so\n.Python\nenv/\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# Generated MIDI files\n*.mid\n\n# Virtual Environment\nvenv/\nENV/\n\n# IDE\n.idea/\n.vscode/\n*.swp\n*.swo\n\n# OS\n.DS_Store\nThumbs.db\n",
"bugtrack_url": null,
"license": null,
"summary": "A MIDI melody generator supporting multiple musical genres",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/JDCurry/midi-melody-generator",
"Repository": "https://github.com/JDCurry/midi-melody-generator.git"
},
"split_keywords": [
"midi",
" music",
" generator",
" melody",
" composition"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2a1b187516841ca8bb4eff20e19a00aa31319bc974ad1a73306cd56a4e7e525e",
"md5": "91517390e467ab91cd2f3044466d52c0",
"sha256": "ce7019dcf9649c364aa43ee9eff8fe4aa5a4acc626a33609ca7bdd4e4e0ae3c2"
},
"downloads": -1,
"filename": "midimelody-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "91517390e467ab91cd2f3044466d52c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4510,
"upload_time": "2025-02-18T09:53:23",
"upload_time_iso_8601": "2025-02-18T09:53:23.452336Z",
"url": "https://files.pythonhosted.org/packages/2a/1b/187516841ca8bb4eff20e19a00aa31319bc974ad1a73306cd56a4e7e525e/midimelody-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0d914e96c7a8de4829b05cba5244e757d136a9992c9685265bb955f8912b5eed",
"md5": "0061249083faf0cf0566c1a091d227f5",
"sha256": "d3ea5f61bf4fcd4ab8009056b91e92c127075b9200459ac178d47a5f377a9fe2"
},
"downloads": -1,
"filename": "midimelody-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "0061249083faf0cf0566c1a091d227f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5203,
"upload_time": "2025-02-18T09:53:24",
"upload_time_iso_8601": "2025-02-18T09:53:24.425273Z",
"url": "https://files.pythonhosted.org/packages/0d/91/4e96c7a8de4829b05cba5244e757d136a9992c9685265bb955f8912b5eed/midimelody-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-18 09:53:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JDCurry",
"github_project": "midi-melody-generator",
"github_not_found": true,
"lcname": "midimelody"
}