I was trying to create a song and figured out what the melody would be like. I played it on my guitar and jotted down the chords in a notebook. The next morning i tried playing it, but i completely forgot how the tune went/what the rhythm was like. Is there any way to retain that tune in your memory? Or is it something wrong with me?
I also had this problem so i overcome by recording the tune by humming the melody using my mobile phone recorder as anyone always carry a i phone even during travel or any other moment.This had helped me to keep remember the melody which comes in my mind and later on i will sit with my keyboard and play the notes and write the notes in a music sheet using muse score notation software.You can also follow this method. There is nothing wrong in you as human brain cannot remember the melody which accidently comes in our mind hence we need some method to instanty record it and refer for future.
I agree that you should record yourself. You could also learn to notate music. You either write it out on a staff or use something like solfege to make notes of how the melody went.
I think this is a common thing for many people. You hear about the great composers or writers who always keep a notebook with them on order to jot down notes so they won't forget them later. Remembering something new takes repetition or a strong context, which is likely since it is something new!