This Probably was my Victor Frankenstein moment. God's complex or God's conundrum.
After that, refining the model was pretty peachy, The AI wrote an extension of my poems. And I think it was quite thoughtful. Okay, at least it was a bunch of fully-formed meaningful sentences... stuck together mostly out of any context. And that was actually what's expected if we look into the way Recurrent Neural Networks work.
My Poem Extended By AI |
As long as there were words and were arranged together in a manner that would pass as a sentence at first glance; I was proud of my little AI monster. After all, it is just a child in front of the giants, from open AI & hugging face. Those transformer-based models are trained on a ginormous amount of information. The adjective State-of-The-Art is often associated with such models. They have is these delightful websites interfaces where you could just go and type one line to text and In return, they would generate a book for you! I so wish I had that during my academic years. I would have saved so many midnight candles that I burnt on completing the assignments. The assignments that, I still believe, no one ever read.
Getting unstructured sentences from the model, got me thinking; If only language had a set of rules that were slightly less intricate. Maybe had a certain strick pattern ... a sort of key. Like musical compositions have. Like Mozart's Symphony No 40, one of his most popular, in the key of G minor. the symphony is literary known as the great G minor.
Sound is created by vibrations in the air. There can be infinite kinds of soundwaves as there are infinite combinations of frequencies and amplitudes. In music, we consider pitch and wavelength. As there are infinite soundwaves there can be infinite musical notes. However, contemporary music uses12 unique notes. The 12 notes have a constant difference in frequency with respect to each other.
Twelve Notes on Piano |
Though there are far more keys on a piano, all of them are different versions of those 12 notes on musical instruments. Say in the above image the key of A has a frequency of 220 Hz. The next assortment of keys will be set in a different octave and that A will be of frequency 440 Hz. Each shift in the octave doubles the frequency.
Twelve Tone Musical Scale |
Not all of the notes sound good together, there are a selected set of notes that are used in a song. This set of selected notes are indicative of the Key. When a song is in the key of C Major or D Minor this is simply telling you which of the 12 notes are used in this song.
Back to the initial topic, This sets up an easier pattern for a Recurrent Neural Network to learn than to learn a language with a strict syntax and oh so many exceptions. Besides even if it breaks those rules, I would never know.
I went further down the valley and made my first AI model generate music. I trained it with Frédéric Chopin's compositions. On second thought I think, Beethoven would have been an ideal candidate. Nonetheless, I did skip over my initial plan to work with Mozart's works... Ugh! What the hell I didn't want to work on data scraping there I said it! So I found this big dataset on Kaggle and Chopin’s was the one with the most files.
The first output was basically "something" ponding on the same key with one finger at a constant interval of time. It was still an art form, in my opinion, Made me think deep and hard about existence and how we should all be just annihilated right on the instinct the next note is played. The longer I played it the more I was convinced of it
After making a few tweaks in the architecture of the network It worked alright not as good as Frédéric Chopin's. Still, it is nice. See for yourself.
On scrutinising the generated melody, as it has a variety of notes; I am quite satisfied. On the enigma, is it a good musical composition; is it artsy? Did the AI create a masterpiece? I don't know! I am not a connoisseur of music. I used a Recurrent Neural Network and it worked alright. I decided to let the AI have the fame it deserved.
So, I am releasing the album here on this blog! Yey! Don't forget to get your copy!
Get your copy:
Afternoon On Pluto
Almost A Lovesong (for Zombies)
Children's Rhyme By The Clown
Homealone In Lockdown
Midnight Intruder
Netflix and Videocall
Secret Stash
Up The Infinite Castel
Nice job
ReplyDeletePlease Can You give me the Trained model for Lyrics and Music ?