Skip to content
← Back to Community
Ko-L : Turn your lyrics into tunes !
Profile icon
JoyBanerjee

Hello everyone, my name is Joy Banerjee and this is the first time I'm taking part in a repl.it challenge ! :D

Introduction

This project's name is pronounced as 'Ko-el', and is named after the bird 'Asian Koel', which has a very sweet sounding call.

I have tried to make the project as professional as possible, and that's why I have included MIDI file generation as a part of this project. So when vocalists and musicians are looking for inspiration, they can use this website to get some ideas, and import those ideas to their music software using the generated MIDI.

This project was difficult enough for a single person to complete within 3 days, and I saw this challenge the day before yesterday lol. Anyway, I did as much as I could, and I really hope people enjoy my project and find my project useful ! :D

Algorithm

So the aim of this project is to turn your lyrics into tunes. How it does that ? It breaks down your words into syllables, and then it assigns a music note to them, based on the scale you select. Sounds easy right ? and It is easy !

But the main trouble comes when your are generating the MIDI file of the lyrics, then there's a lot of hassle ! When you are generating MIDI, you have to deal with both notes and timings. So what I have done is, when the lyrics contains several lines, the algorithm will detect each line, and will assign timings to the notes in each of those lines, such that a single line can be finished in 1 Bar. So for example, a line : "Hello it is me" would be "Hello(1/4) it(1/4) is(1/4) me(1/4)" . As 4 quarter notes gives 1 bar.

Another thing my algorithm detects, is the 'rest' note, so if you place a comma in the lyrics, then it will count that as a rest note.

If you are curious about the algorithm, then this type of problems are called 'Integer Partitioning Problems', but my case is not simple Integer Partitioning problem, as I have constraints like 1 bar cannot be filled by just any combination of numbers, it has to use the combination of 1,1/2,1/4,1/8 and 1/16 fractions or beats and it must assign these numbers to all the notes/syllables in 1 bar.

Last and a very important thing I did was, add random note repetitions and generate random notes around a pivot note. Random note repetitions will make things sound more real, as singers don't always change notes with new syllables. And the random note around a pivot note will ensure the randomly generated notes doesn't jumps around the 2 octaves (C3 to C#5), which will again sound unrealistic (and kind of like Tarzan's yell !)

How to run it :

Here's the step by step guide on how to use this project :

  1. Enter your lyrics in the top text box (copy paste lyrics without any brackets from https://genius.com/ just to test it)
  2. Select a scale
  3. Select the note repetition scale (higher the number, more the notes are repeated consecutively)
  4. Select your BPM
  5. Enter the name of your song (midi files will be saved with this name)
  6. Click 'Show me what you got !'

Disappointed with the results or the song isn't playing ? Just refresh ! Make sure you click 'Resend' or something similar to generate new tunes, otherwise it will fail.
image

If you face any difficulty, feel free to reach out to me, and I really hope you enjoy this project ! :D

Thank you !

Note :

Please remember to open the website in a new tab, and not use it from repl.it's window, otherwise you will not get the full experience !

I have tested the website in Windows Google Chrome and Android Google Chrome, and it works as expected.

**If there's no animation in the website, then please do a hard refresh : **
Windows: ctrl + F5
Mac/Apple: Apple + R or command + R
Linux: F5

Here's two pictures of the website :

  1. Entering a sample :
    image

  2. Getting the lyrics with notes :
    image

Voters
Profile icon
amasad
Profile icon
katyadee
Profile icon
JoyBanerjee
Comments
hotnewtop
Profile icon
amasad

Very cool concept but I thought it was going to sing it too 🤡

Profile icon
JoyBanerjee

@amasad Send me your lyrics and tunes and I'll sing it for you in a voice of a crow ! :P

Profile icon
abc3354

Cool !

Profile icon
JoyBanerjee

@abc3354 Thanks ! :D