Exploring music creation with ChatGPT4 - mixing Bach with Frank Zappa
May 15th, 2023

Hi there! Do you want to know how to experiment with music creation using chatGPT?

Here's a method that works well and provides exciting outcomes.
But firstly, let's consolidate some fundamental concepts.

What is ChatGPT4 ?

ChatGPT is an AI-powered natural language processing tool that enables you to engage in lifelike conversations and offers a wide range of additional capabilities. This language model can provide answers to inquiries and aid you in various tasks, including composing emails, essays, and code.

In more precise terms, ChatGPT is an AI-driven language model specifically designed to generate text that closely resembles human speech and engage in conversations, hence the inclusion of "Chat" in its name.

2017 Logo of OpenAI
2017 Logo of OpenAI

The current GPT4 model doesn't have a music generation feature but I found a workaround .. Ever heard about ABC notation?

What are ABC notations?

ABC notation is a shorthand form of musical notation for computers. In basic form it uses the letter notation with a–g, A–G, and z, to represent the corresponding notes and rests, with other elements used to place added value on these – sharp, flat, raised or lowered octave, the note length, key, and ornamentation.

![Farzaneh, Majid & Mahdian, Rahil. (2020). GGA-MG: Generative Genetic Algorithm for Music Generation.

](https://www.researchgate.net/profile/Majid-Farzaneh-2/publication/340541536/figure/fig1/AS:878611703791616@1586488762173/An-example-of-ABC-notation-language.png)

Now that we have a basic understanding of the process, let's dive in ...

1 . Open ChatGPT4

Go to chat.openai.com > select GPT-4 Remember you need a paid subscription to use GPT4

2. Find an example of ABC notation to feed chatGPT so that it can learn from it.

ABCnotation.com is great starting point.

3. Ask GPT4 to learn the ABC notion format

Prompt:

Please examine this sample of a composition written in ABC Notation and prepare yourself to create more pieces in a similar style.

Here's my full prompt screenshot:

ChatGPT4 screenshot
ChatGPT4 screenshot

Here's the ChatGPT4 reply to my prompt:

The ABC Notation you provided describes a four-part choral piece, reminiscent of a typical Bach chorale. Each line represents a voice: Soprano (V:1), Alto (V:2), Tenor (V:3), and Bass (V:4). The music is in the key of G Major and in 3/4 time, as indicated by the "M: 3/4" and "K: G" lines.

Some key observations:

  • The piece uses a common tonal structure, with each voice contributing to the overall harmony.

  • The soprano line often carries the main melody, while the alto, tenor, and bass provide harmonic support.

  • There is a good use of stepwise motion and occasional leaps in all voices, creating a balance between conjunct and disjunct motion, which is typical in chorales.

  • The "fermata" signs (notated as "!fermata!") denote that the note should be held longer than its natural duration, which often indicates the end of a phrase or section.

  • In some instances, one voice might move while others hold their notes, creating a sense of movement and interest.

  • The piece ends on a G Major chord, providing a resolution to the key it started in.

To create a new piece in a similar style, follow these guidelines:

  1. Key and Time Signature: Choose a key and time signature. The example is in G Major and in 3/4 time, but other keys and time signatures can also be used.

  2. Melody: Write a simple, stepwise melody in the soprano voice. Occasional leaps can be used for variety.

  3. Harmony: Write the alto, tenor, and bass voices to harmonize with the soprano. Generally, each chord should include the first (tonic), third (mediant), and fifth (dominant) of the current key.

  4. Counterpoint: Ensure that there's some movement in the inner voices (alto and tenor), not just the soprano and bass.

  5. Cadences: Use appropriate cadences at the end of phrases. In the key of G Major, a perfect cadence would be D to G.

  6. Fermatas: Use fermatas to mark the ends of phrases or sections.

  7. Resolution: End the piece with a strong resolution to the tonic chord of the key you chose.

It's important to remember that writing music is a creative process, so feel free to experiment and make the piece your own!

4) It looks like the the GPT4 model has learnt from my example the ABC notion format, let's try to mix it with …Frank Zappa

Prompt:

Blend my ABC notion example with a piece from Frank Zappa called Peaches en Regalia, provide the ABC notion text format

Here's the ChatGPT4 reply to my prompt:

Blending two pieces from different composers and musical styles can be a complex task, especially since Frank Zappa's music is known for its experimental nature and wide range of influences, from rock and pop to jazz and classical music. "Peaches en Regalia" is a particularly intricate piece, featuring a melodic line that is both catchy and rhythmically complex.

Since ABC notation is generally used for simple folk and traditional tunes, it might not fully capture the complexity of Zappa's piece. But I'll try to create a simplified version that captures some of the main themes and blends them with your ABC Notation example.
Nonetheless, here's a simplified attempt:

X:1
T: Sonata I & Peaches en Regalia Blend
C: J.S. Bach & Frank Zappa
M: C
Q:"Allegro"
L: 1/8
K:C
V:1 clef=treble name="Violino I" sname="Vl. I"
V:2 clef=treble name="Violino II" sname="Vl. II" space=+10
V:3 clef=bass name="Violoncello\<Vla. da Gamba>" sname="Vc."
[V:1] g8-|gf/e/ {e}f>g (a/f/d/f/) (A//=B//A//B//TB3//A///B///)|
[V:2] z8 | z8 |
[V:3] z cec gGBG | Aa- a/_b/a/g/ f3 g/f/ |
%
[V:1] c/gf/ E/ed/ c/c'b/ A/ag/ | ^f/e/d- d/(c/B/A/) G/(e/c/e/) Aa| d2-d/g/_b/a/ a3 g/=f/|
[V:2] c8- | cB/A/ {A}B>c (e/c/A/c/) (E//^F//E//F//TF3//E///F///) | G/(D/G/A/) _B/G/g/e/ ^cA d2-|
[V:3] edcB AG^FE | D^FGg c3d/c/| _BG g2-gf/e/ f>g|
%
"Zappa Melody"
[V:1] c2 c2 Bc d2 | e2 e2 de f2 | g2 g2 gf g2 | a2 a2 ab c'2 |
[V:2] z8 | z8 |
[V:3] z gba fedc | ded- d/_e/d/c/ b3 a/g/ |
%
"Zappa Melody"
[V:1] d'2 d'2 cd' e'2 | f'2 f'2 ef' g'2 | a'2 a'2 a'b' a'2 | g'2 f'2 ef' d'2 |
[V:2] z8 | z8 |
[V:3] z ded cBAG | FED- E/_F/E/D/ C3 D/E/ |
%
"Back to Bach"
[V:1] c/gf/ E/ed/ c/c'b/ A/ag/|^f/a/g/f/ g2-g>e' f2-|f/e^d/ e2-e>c' =d2-|
[V:2] DG, G/gf/ E/ed/ =c/c'B/|ad'- d'/c'/d'/e'/ Ta/>g/a- a/c'/b/^f/|(g//a//g
[V:3] cB/G/ cC zgac- |cb/>a/ b>c' d'c'd'd| e^fga babB|

5. Let's convert the ABC notion into music using a text-to-music converter

Here's the results :)
collect this NFT below to get the links to all the websites used for this tutorial and own this song.

What an apt and peculiar conclusion to this little experiment! Did you enjoy this tutorial?

I would love for you to share your results with me!

πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡

Please consider to subscribe to my channel if you like these contents:

πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡

Thank you!

This tutorial is brought to you by @iamsimoleo

Subscribe to Simo's thoughts
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Simo's thoughts

Skeleton

Skeleton

Skeleton