Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d3n7/GPT-4-To-MIDI
Text prompt to MIDI File using OpenAI's GPT-4
https://github.com/d3n7/GPT-4-To-MIDI
Last synced: 3 months ago
JSON representation
Text prompt to MIDI File using OpenAI's GPT-4
- Host: GitHub
- URL: https://github.com/d3n7/GPT-4-To-MIDI
- Owner: d3n7
- Created: 2023-03-31T00:11:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T13:30:39.000Z (9 months ago)
- Last Synced: 2024-08-04T00:11:01.414Z (6 months ago)
- Language: Python
- Size: 64.5 KB
- Stars: 61
- Watchers: 8
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-gpt4 - MusicGPT - Make polyphonic music in the form of MIDI files with GPT-4 or 3.5. (Tools / Open-source projects)
README
# GPT-4 To MIDI
Text prompt to MIDI File using OpenAI's GPT-4. Now with polyphony and MIDI input![Web interface available on HugginFace](https://huggingface.co/spaces/cbg342/GPT-4-To-Midi)
# Dependencies:
```pip install openai midiutil mido```# Usage:
Ask it in plain english to generate, including any musical details that you want.Input:
```
python g2m.py -p "Full piece of melancholy music with multiple parts. Plan out the structure beforehand, including chords, parts (soprano, alto, tenor, bass), meter, etc." -c
[*] Making request to OpenAI API
[*] Parsing content
[*] Wrote the MIDI file.Next prompt> Keep it Eb instead of E for the second note
...
Next prompt> Write a simple soprano melody in the high octave range that fits over this piece.
```Output:
https://user-images.githubusercontent.com/29033313/229352561-a0b16078-4d5b-4381-b433-673d38d4d987.mp4
Input:
```python g2m.py -p "Full piece by Mozart with multiple parts. Plan out the structure beforehand, including chords, parts (soprano, alto, tenor, bass), meter, etc. Over 400 notes total."```
Output:
https://user-images.githubusercontent.com/29033313/229316684-028d2e55-9f4e-4a0e-a47a-a99452d9d14f.mp4
Input:
```
python g2m.py -p "twinkle twinkle little star" -c
[*] Parsing content
[*] Wrote the MIDI file.Next prompt> Tranpose it to A minor
```Output:
https://user-images.githubusercontent.com/29033313/229319912-6b3ec70c-d77b-4e6e-a537-41a9c5aeabc6.mp4
Full options:
```
-h, --help show this help message and exit
-p PROMPT, --prompt PROMPT
specify prompt to use (default: Jazz!)
-c, --chat send follow up messages to make revisions,
continuations, etc. (type 'exit' to quit)
-l LOAD, --load LOAD load a MIDI file to be appended to your prompt
-v, --verbose display GPT-4 output
-o OUTPUT, --output OUTPUT
specify output directory (default: current)
-a AUTH, --auth AUTH specify openai api key (edit this script file to set a
default)