menu Home chevron_right
WEIRD

I Created an AI That Wrote Music

Qxir | March 26, 2026



This is a project I made a year or so ago for my final year of college. It’s an AI that utilises the power of neural networks (specifically recurrent neural networks (specifically specifically Long Short-Term Memory or LSTM)) to study music and learn to write its own.

“Artificial neural networks (ANN) or connectionist systems are computing systems inspired by the biological neural networks that constitute animal brains. The neural network itself is not an algorithm, but rather a framework for many different machine learning algorithms to work together and process complex data inputs. Such systems “learn” to perform tasks by considering examples, generally without being programmed with any task-specific rules. For example, in image recognition, they might learn to identify images that contain cats by analyzing example images that have been manually labeled as “cat” or “no cat” and using the results to identify cats in other images. They do this without any prior knowledge about cats, for example, that they have fur, tails, whiskers and cat-like faces. Instead, they automatically generate identifying characteristics from the learning material that they process.

An ANN is based on a collection of connected units or nodes called artificial neurons, which loosely model the neurons in a biological brain. Each connection, like the synapses in a biological brain, can transmit a signal from one artificial neuron to another. An artificial neuron that receives a signal can process it and then signal additional artificial neurons connected to it.

In common ANN implementations, the signal at a connection between artificial neurons is a real number, and the output of each artificial neuron is computed by some non-linear function of the sum of its inputs. The connections between artificial neurons are called ‘edges’. Artificial neurons and edges typically have a weight that adjusts as learning proceeds. The weight increases or decreases the strength of the signal at a connection. Artificial neurons may have a threshold such that the signal is only sent if the aggregate signal crosses that threshold. Typically, artificial neurons are aggregated into layers. Different layers may perform different kinds of transformations on their inputs. Signals travel from the first layer (the input layer), to the last layer (the output layer), possibly after traversing the layers multiple times.

The original goal of the ANN approach was to solve problems in the same way that a human brain would. However, over time, attention moved to performing specific tasks, leading to deviations from biology. Artificial neural networks have been used on a variety of tasks, including computer vision, speech recognition, machine translation, social network filtering, playing board and video games and medical diagnosis.”

More on Wikipedia:
https://en.wikipedia.org/wiki/Artificial_neural_network

Discord: https://discord.gg/jZzvvwJ
Patreon: https://www.patreon.com/qxir

Written by Qxir

Comments

This post currently has 27 comments.

  1. @y_fam_goeglyd

    March 26, 2026 at 4:42 pm

    Back in the early 80s, I went to a lecture/demonstration on computers and music. They had a PC – something so new I'd never been in the same room as one before. My friends who were doing an O level in computing (older version on GCSEs, taken in the school year when you turn 16) were taken once a week to the one school in our area which had a computer, and they were writing programs on punch cards. You get the idea of where computing was at this point.

    Anyway, it was a really interesting lecture, and it was about much the same thing as in this video, except they programmed the PC to write its own music. No AIs as such, it was randomised output, but IIRC they had given the program information on a few basic musical keys and timing and then let it run.

    They discovered (not really to much surprise to me when I thought about it; his music is very mathematical, in tempo naturally, but also in the melody & harmony) that the music sounded much like that of JS Bach. They named the pieces the "Randomburg Concertos," and they were actually easy on the ear. As a JSB fanatic, even as a kid, I was thrilled by it.

    Listening to this took me back over 40 years, to a time when I was really happy (not that I'm miserable now! But it's much easier being a kid than a grandma), sp thank you for sharing this.

  2. @booze_walk

    March 26, 2026 at 4:42 pm

    i wasn't gonna comment, but without mentioning your song choice, I'm just a little older- So I'd say
    Paula Abdul – Straight Up. (i even liked this a lot as a non-English Speaking kid in Poland). Maddona's La Ilsa Bonita is swell too….
    …if it comes to men Rockers? Dire Straits Money For Nothing. (White Zombie's Thrust… Megadeth's Liar are great metal)

    sadly my Myspace was erased, music, jokes and all… when Myspace erased itself….

    dangit, i didn't wanna be obnoxious. ok, 2/3 way through…

  3. @nathanielrose274

    March 26, 2026 at 4:42 pm

    It really likes dissonance. It appears to not understand that the 3/4ths and 2/3rds ratios of perfect 4ths and 5ths are pleasing to humans, or why 25/18 and 17/9 ratios of minor 4ths and major 7ths sound weird to us. So it thinks it is being fancy by coming up with the most mathematically complex combination of notes. Some musical genius will likely realize its timing has some crazy mathematical relationship with the combinations of frequencies it is choosing. It is probably just music so advanced it is beyond our comprehension of its intricacies. At least that is the line I use whenever someone tries to subject me to the band Tool after I realized Tool fans just argue with you when you tell them it sounds like shit.

  4. @mrj3217

    March 26, 2026 at 4:42 pm

    The future does not have humanity in it.
    Once we create an AI that can create them selfs we as a species are extinct.
    Think about that why don't ya .

  5. @RationalGaze216

    March 26, 2026 at 4:42 pm

    My dad did some work on the original creation of midi software. To this day I have no idea what exactly his job was, but he was still getting royalty checks from it up until a couple of years ago.

  6. @marcmckenzie5110

    March 26, 2026 at 4:42 pm

    Qxir, I have suspected you worked in computer science! You remind me so much of what I was like 40 years ago. You didn’t ask for advice, but here it is anyway… stay focused on interesting problems, especially ones that can make a difference, and not on wealth. Wealth will take care of itself, if you do the former. And by wealth, I mean you will have enough. Best wishes.

Comments are closed.




This area can contain widgets, menus, shortcodes and custom content. You can manage it from the Customizer, in the Second layer section.

 

 

 

  • play_circle_filled

    92.9 : The Torch

  • play_circle_filled

    AGGRO
    'Til Deaf Do Us Part...

  • play_circle_filled

    SLACK!
    The Music That Made Gen-X

  • play_circle_filled

    KUDZU
    The Northwoods' Alt-Country & Americana

  • play_circle_filled

    BOOZHOO
    Indigenous Radio

  • play_circle_filled

    THE FLOW
    The Northwoods' Hip Hop and R&B

play_arrow skip_previous skip_next volume_down
playlist_play