How to Get GPT-3 to Write Music

How to Get GPT-3 to Write Music

Dec 19, 2022Jeffrey Ganim

Does Open AI's GPT-3 know music? Yep! It can understand and write music, and we can prove it, and show you how to get it to write music too.

How to Get GPT-3 to Write Music

To get GPT-3 to write music you need to use a notation that is in text form. Since GPT-3 can't write in standard musical notation, you must use text.

We've confirmed that GPT-3 can understand and write music in the forms:

- Guitar tabs (and likely other musical "tabs" such as piano tabs)

- ABC notation - this is our favorite as it's easy to paste into a player and immediately hear. You can paste this notation into this player, online for free.

- Common Practice Period form (can be pasted into Sibelius, Finale, or MuseScore 

GPT-3 Music Prompt

You can use this prompt below for free. It gives GPT-3 a few examples to guide the results to correctly format the ABC notation. Change up the prompt (don't forget to change the title of the song at the end, to get a different song. When you're done paste the results here to hear the AI generated song. Some of the results are downright beautiful.

Music Prompt to Guide Results

Below is a short new epic new violin solo written by JS Bach in ABC notation (format according to the formatting examples below). 

Formatting example:

X:1

T:Speed the Plough

M:4/4

C:Trad.

K:G

|:GABc dedB|dedB dedB|c2ec B2dB|c2A2 A2BA|

GABc dedB|dedB dedB|c2ec B2dB|A2F2 G4:|

|:g2gf gdBd|g2f2 e2d2|c2ec B2dB|c2A2 A2df|

g2gf g2Bd|g2f2 e2d2|c2ec B2dB|A2F2 G4:|

 

Formatting example 2:

 

X:1

T:Lamma bada yatathanna

Z:Tous aux Balkans !

F:http://www.tousauxbalkans.net/Lamma_bada_yatathanna

Q:1/8=96

M:10/8

L:1/16

K:Gm

D2 \

%%MIDI gchord f2z2czf2z2czczf2z2cz

|: "Gm"G4AB "Cm"cBBA "D"AGG^F "Gm"G4D2 | "Gm"G4AB "Cm"cBBA "D"AGG^F "Gm"G4AB |

"Cm"c4d2 "Gm"B3A "D"AGG^F "Gm"G4AG | "D"^F4GF "Cm"E3D EDEF "D"D4ED | "Cm"C4D2 "Gm"B,3A, "D"A,G,G,^F, G,4D2 :|

"Gm"G4AB "Cm"cBBA "D"AGG^F "Gm"G4D2 | "Gm"G4AB "Cm"cBBA "D"AGG^F "Gm"G4B2 |

"Bb"B4B2 B4 B2Ac B4B2 | "D"d4c2 dcBA "Gm"BAGB "F"A4=F2 | "Gm"G4A2 "Bb"B4 B2Ac B4AB |

"Cm"c4d2 "Gm"B3A "D"AGG^F "Gm"G4AG | "D"^F4GF "Cm"E3D EDEF "D"D4ED | \

%%MIDI gchord f2z2czf2z2czczf6

"Cm"C4D2 "Gm"B,3A, "D"A,G,G,^F, G,6 |]

X1:

T:Epic new short violin solo by JS Bach

 

 

Avoiding Repetition

Repetition can be an issue when asking GPT-3 to compose music. As a text-prediction model, it can easily get stuck in a loop, and just keep repeating the same parts over and over again. Using the prompt example above can help, though it does still happen fairly often. If you've solved this let us know in the comments!

 

Song Example: JS Bach's Escape to the Stars

This was a wild experience. We asked GPT-3 to create a song by JS Bach about escaping to the stars. If you listen to this in the ABC Notation player, you'll hear it sounds very much like you expect a song about space to sound like.

 

X:1
T:Chaconne Battle to Escape to the Stars for violin quartet
M:4/4
L:1/4
Q:1/8=120
K:Dmin
%%MIDI program 78
%%MIDI gchord fzczfzcz
I:trill (8va) 64
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin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d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|
"Dmin"d4|"Bb"d2f2|"F"e2c2|"Dmin"d4|e4|f2d2|"Bb"c2A2|"F"A4|

GPT-3 & ChatGPT Claim They Can't Write Music

Does't AI have any self awareness these days? As we've seen, GPT-3 is capable of writing music, and ChatGPT, which is supposedly the next evolution of GPT-3 says the same thing. This shows the limitations of asking an AI, at least a text-completion AI like GPT-3/ChatGPT, about itself.

GPT-3 Says it Can't Write Music

gpt-3 on music writing

ChatGPT Says it Can't Write Music

chat GPT on music

 



More articles

Comments (0)

There are no comments for this article. Be the first one to leave a message!

Leave a comment