{"course":{"slug":"ai-actually-explained","title":"AI, Actually Explained","url":"https://addaly.com/learn/ai-actually-explained","level":"beginner","track":"start"},"lesson":{"slug":"music-from-a-prompt","title":"Music from a prompt","url":"https://addaly.com/learn/ai-actually-explained/music-from-a-prompt","position":58,"of":92,"minutes":8,"answer":"A music model turns sound into tokens and predicts the next one, which is why it produces a convincing three-minute song in a genre and cannot hold a motif.","keyIdea":"A music model turns sound into tokens and predicts the next one, which is why it produces a convincing three-minute song in a genre and cannot hold a motif, follow a chord chart or edit one bar."},"body":{"format":"markdown","text":"## Sound is a sequence too\n\nThe history module told you the transformer did not care what its sequence was made of. Music was one of the first things after text to prove it. Two designs are in use, and both are things you have already met.\n\nThe first is the chatbot's trick applied to sound. A separate small network (a codec) compresses audio into a stream of discrete tokens, a few dozen per second. A transformer is trained to predict the next audio token given the previous ones and a text description. Generation is the next-word game with a different alphabet; the codec turns the tokens back into sound at the end. Meta's 2023 open model works this way, and so, by every account, do the commercial services.\n\nThe second is the image trick. A spectrogram (a picture of sound with time along one axis and pitch along the other) is just an image, and in December 2022 two hobbyists fine-tuned Stable Diffusion on spectrograms and got music out of a picture generator. It was a proof that the mechanism did not care.\n\n## What it does well\n\nAsked for \"a slow bhangra-influenced pop song about leaving Ludhiana, female vocal, two minutes\", a 2025 service produces exactly that in under a minute: intelligible lyrics, a chorus, a bridge, mixed and mastered to the loudness of a streaming release. The quality is the point; there is no marketing exaggeration in saying a listener would not pick it out of a playlist. Two American services launched in 2023 and 2024 and gained millions of users on that basis.\n\nThe reason it is good at this is the reason the chatbot is good at prose. Recorded music in every genre is abundant, and the format (verse, chorus, verse, chorus, bridge, chorus) is one of the most regular structures humans produce.\n\n## What it cannot do, and the mechanism\n\n**Hold a motif.** Ask for a melody that returns transformed in the third verse, and it does not. At a few dozen tokens a second, a three-minute song is many thousands of steps, and the model's attention over that distance is thin. The chorus that comes back is a *similar* chorus: the likeliest continuation of \"chorus again\", not a recall of the first one. This is the context-window limit from the chatbot module, in sound.\n\n**Follow a chart.** Give it the chords of a song and ask it to play those, in that order, in that key. It produces something in the right style with chords that are mostly not those. It never learned chords as objects; it learned what recordings tagged with those words sound like.\n\n**Edit a bar.** Change the fourth bar and keep everything else. There is no fourth bar to point at, for the reason there is no finger to count in the drawing lessons. Services offer extend, remix and replace-a-section tools, and each re-generates a region from scratch and hopes it fits.\n\n**Sing clearly at speed.** Fast or dense lyrics smear, because the codec's tokens carry timbre and pitch better than consonants.\n\n## The copyright fight\n\nIn June 2024 the three largest record companies sued both leading services, alleging that the models had been trained on their catalogues without licence, and asking for damages of up to a hundred and fifty thousand dollars per work. The services' position was that training on recordings to learn the patterns of music is a fair use, and that their output is new. By late 2025 the first settlements had been announced, turning some of the defendants into licensees while other claims continued.\n\nThat is the shape of the argument and this course does not resolve it, because courts and legislatures have not. Two things are not in dispute. Style is not protected by copyright in any major jurisdiction, so a song \"in the style of\" a living artist is not, by itself, infringement. And recordings are protected, so whether training on them without permission is lawful is exactly the question. A later module puts this case beside the ones about text and images.\n\n## The free path\n\nThe two commercial services are subscription products. Meta's 2023 model is open-weights under a non-commercial licence and runs on a modest graphics card; a 2024 open model from the company behind Stable Diffusion generates sound effects and short music under a permissive licence; and a Chinese open model from early 2025 produces full songs with vocals. All run in a free hosted notebook. For everything after generation (cutting, layering, mastering) the free tools are the same ones a studio would use for the job: Audacity for editing, LMMS or Ardour as a full digital audio workstation, against the paid Ableton and Logic that job advertisements name. Every one of the failures above is fixed the same way a human producer fixes them: by editing the audio, not by asking the model again."},"check":{"question":"A music model is asked for a song whose chorus melody returns, transformed, in the final verse. It produces a song with a chorus that comes back nearly unchanged, and no transformation. Why?","options":[{"text":"The model was trained on pop music, where choruses are always repeated exactly.","correct":false,"tempting":"Blames the genre; the failure is that the returning chorus is a similar chorus, not a recall, whatever the genre."},{"text":"The prompt should have specified the key and tempo so the model could plan the transformation.","correct":false,"tempting":"Assumes the model plans; it predicts the next token and has no plan to be helped by the extra detail."},{"text":"The song is thousands of tokens long and attention over that distance is thin, so \"chorus again\" yields the likeliest chorus, not a recall.","correct":true},{"text":"The codec that turns tokens back into sound discards melodic information, so the model has no way to hear what it played earlier in the same song.","correct":false,"tempting":"Puts the loss in the wrong place; the codec preserves melody well, and the loss is in the model's long-range structure."}]},"prev":{"slug":"cloning-a-voice","title":"A voice from three seconds","url":"https://addaly.com/learn/ai-actually-explained/cloning-a-voice"},"next":{"slug":"why-video-is-harder","title":"Why video is so much harder than a still","url":"https://addaly.com/learn/ai-actually-explained/why-video-is-harder"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Music from a prompt', in AI, Actually Explained. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-actually-explained/music-from-a-prompt (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Music from a prompt","courseTitle":"AI, Actually Explained","module":{"index":6,"slug":"beyond-text","title":"Beyond text: pictures, voices and video"},"answer":null,"keyIdea":"A music model turns sound into tokens and predicts the next one, which is why it produces a convincing three-minute song in a genre and cannot hold a motif, follow a chord chart or edit one bar.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"sound-is-a-sequence-too","runs":[{"text":"Sound is a sequence too"}]},{"t":"p","runs":[{"text":"The history module told you the transformer did not care what its sequence was made of. Music was one of the first things after text to prove it. Two designs are in use, and both are things you have already met."}]},{"t":"p","runs":[{"text":"The first is the chatbot’s trick applied to sound. A separate small network (a codec) compresses audio into a stream of discrete tokens, a few dozen per second. A transformer is trained to predict the next audio token given the previous ones and a text description. Generation is the next-word game with a different alphabet; the codec turns the tokens back into sound at the end. Meta’s 2023 open model works this way, and so, by every account, do the commercial services."}]},{"t":"p","runs":[{"text":"The second is the image trick. A spectrogram (a picture of sound with time along one axis and pitch along the other) is just an image, and in December 2022 two hobbyists fine-tuned Stable Diffusion on spectrograms and got music out of a picture generator. It was a proof that the mechanism did not care."}]},{"t":"h2","id":"what-it-does-well","runs":[{"text":"What it does well"}]},{"t":"p","runs":[{"text":"Asked for “a slow bhangra-influenced pop song about leaving Ludhiana, female vocal, two minutes”, a 2025 service produces exactly that in under a minute: intelligible lyrics, a chorus, a bridge, mixed and mastered to the loudness of a streaming release. The quality is the point; there is no marketing exaggeration in saying a listener would not pick it out of a playlist. Two American services launched in 2023 and 2024 and gained millions of users on that basis."}]},{"t":"p","runs":[{"text":"The reason it is good at this is the reason the chatbot is good at prose. Recorded music in every genre is abundant, and the format (verse, chorus, verse, chorus, bridge, chorus) is one of the most regular structures humans produce."}]},{"t":"h2","id":"what-it-cannot-do-and-the-mechanism","runs":[{"text":"What it cannot do, and the mechanism"}]},{"t":"p","runs":[{"text":"Hold a motif.","b":true},{"text":" Ask for a melody that returns transformed in the third verse, and it does not. At a few dozen tokens a second, a three-minute song is many thousands of steps, and the model’s attention over that distance is thin. The chorus that comes back is a "},{"text":"similar","i":true},{"text":" chorus: the likeliest continuation of “chorus again”, not a recall of the first one. This is the context-window limit from the chatbot module, in sound."}]},{"t":"p","runs":[{"text":"Follow a chart.","b":true},{"text":" Give it the chords of a song and ask it to play those, in that order, in that key. It produces something in the right style with chords that are mostly not those. It never learned chords as objects; it learned what recordings tagged with those words sound like."}]},{"t":"p","runs":[{"text":"Edit a bar.","b":true},{"text":" Change the fourth bar and keep everything else. There is no fourth bar to point at, for the reason there is no finger to count in the drawing lessons. Services offer extend, remix and replace-a-section tools, and each re-generates a region from scratch and hopes it fits."}]},{"t":"p","runs":[{"text":"Sing clearly at speed.","b":true},{"text":" Fast or dense lyrics smear, because the codec’s tokens carry timbre and pitch better than consonants."}]},{"t":"h2","id":"the-copyright-fight","runs":[{"text":"The copyright fight"}]},{"t":"p","runs":[{"text":"In June 2024 the three largest record companies sued both leading services, alleging that the models had been trained on their catalogues without licence, and asking for damages of up to a hundred and fifty thousand dollars per work. The services’ position was that training on recordings to learn the patterns of music is a fair use, and that their output is new. By late 2025 the first settlements had been announced, turning some of the defendants into licensees while other claims continued."}]},{"t":"p","runs":[{"text":"That is the shape of the argument and this course does not resolve it, because courts and legislatures have not. Two things are not in dispute. Style is not protected by copyright in any major jurisdiction, so a song “in the style of” a living artist is not, by itself, infringement. And recordings are protected, so whether training on them without permission is lawful is exactly the question. A later module puts this case beside the ones about text and images."}]},{"t":"h2","id":"the-free-path","runs":[{"text":"The free path"}],"role":"free"},{"t":"p","runs":[{"text":"The two commercial services are subscription products. Meta’s 2023 model is open-weights under a non-commercial licence and runs on a modest graphics card; a 2024 open model from the company behind Stable Diffusion generates sound effects and short music under a permissive licence; and a Chinese open model from early 2025 produces full songs with vocals. All run in a free hosted notebook. For everything after generation (cutting, layering, mastering) the free tools are the same ones a studio would use for the job: Audacity for editing, LMMS or Ardour as a full digital audio workstation, against the paid Ableton and Logic that job advertisements name. Every one of the failures above is fixed the same way a human producer fixes them: by editing the audio, not by asking the model again."}]}],"check":{"question":[{"text":"A music model is asked for a song whose chorus melody returns, transformed, in the final verse. It produces a song with a chorus that comes back nearly unchanged, and no transformation. Why?"}],"options":[{"text":[{"text":"The model was trained on pop music, where choruses are always repeated exactly."}],"correct":false,"tempting":[{"text":"Blames the genre; the failure is that the returning chorus is a similar chorus, not a recall, whatever the genre."}]},{"text":[{"text":"The prompt should have specified the key and tempo so the model could plan the transformation."}],"correct":false,"tempting":[{"text":"Assumes the model plans; it predicts the next token and has no plan to be helped by the extra detail."}]},{"text":[{"text":"The song is thousands of tokens long and attention over that distance is thin, so “chorus again” yields the likeliest chorus, not a recall."}],"correct":true,"tempting":null},{"text":[{"text":"The codec that turns tokens back into sound discards melodic information, so the model has no way to hear what it played earlier in the same song."}],"correct":false,"tempting":[{"text":"Puts the loss in the wrong place; the codec preserves melody well, and the loss is in the model’s long-range structure."}]}],"order":[0,1,2,3],"why":null},"prev":{"slug":"cloning-a-voice","title":"A voice from three seconds","minutes":9},"next":{"slug":"why-video-is-harder","title":"Why video is so much harder than a still","minutes":9}}}