Editor’s introduction
The study evaluates MusicAIR, a multimodal AI framework that generates musical scores from lyrical and non-lyrical inputs. The system was assessed using music theory metrics including key confidence, melodic smoothness, and rhythm matching, with results showing an average key confidence of 85%. The generated compositions align closely with established music theory principles and demonstrate coherence in rhythmic and harmonic structure.
Introduction
Generative AI has experienced rapid escalation and integration into daily lives, particularly with the frequent use of conversational chatbots such as ChatGPT powered by Large-Language Models (LLMs). However, AI music generation, especially multimodal inputs from images, lags behind AI art and writing due to its complex structure and required musical expertise. Current methods rely on deep learning, using large datasets for music generation in formats such as song scores, audio, plain text, or other types of data, but face challenges including data collection, copyright risks, high computing costs, and labor-intensive data preparation. also describes a comprehensive survey regarding deep learning methods for music creation. These approaches pose several challenges: 1) significant amounts of data need to be collected to produce more accurate results; 2) potential copyright infringement issues for generated music can arise while training models; 3) high-cost computing resources may be required for training, limiting researchers’ capabilities in producing reliable models for music generation; and 4) most models involve significant data collection and processing, which would frequently necessitate heavy manual labor.
There has been progress made in pure music generation, but lyrics-based music generation has been more difficult. Recently, there has been an increase in text-guided music generation research such as text-to-melody, text-to-music, and text-to-audio generation, where text is not included as lyrics, contributing to pure music generation. However, most of the methods described above are neural-based, and even though many of them incorporate some music theory knowledge and conventions in an effort to create more reasonable models, it could raise the possibility that their generated music diverges from music theory guidelines and proper lyric-note alignment. Additionally, it is possible that utilizing existing songs as data introduces potential copyright infringement issues in the future.
In developing a musically robust song generation method, knowledge of music theory, literature, and linguistics is required to emulate the intuitive thinking process of lyricists, composers, and singer-songwriters, while not necessarily relying on existing music to train and develop such algorithms. Therefore, we propose Music AI fRamework (MusicAIR), an innovative multimodal framework powered by a novel purely algorithm-driven symbolic music core. Our core method only utilizes lyrics and novel algorithms, addressing the challenges listed above. We aim to leverage the correlations between lyrical and musical components, as inspired by where through quantitative analytics, keywords are discovered to have a tendency to land on strong beats to create songs with rhythmic structures suitable for both the lyrics and the melodies. Our approach also attempts to discover latent rhythmic, syllabic, and stress patterns to help determine the rhythm and pitches. The lyrics and the melodies would be properly aligned, with lyrical stress matching the emphasized beats (i.e., strong beats) in the music.
In this paper, we encompass the relationship between lyrics and melody, music theory guidelines, and composers’ intuition to develop a non-neural approach towards AI music generation from lyrics and generate human-sounding music, which differentiates our approach from existing methods in this field.
Lyric-to-Music Generation with Neural Networks
Recent research has investigated the generation of music from lyrics using neural networks techniques, especially deep learning. A cited study develops the melody composition model based on the sequence-to-sequence framework to compose melody from lyrics. A cited study proposes SongMASS that expands upon the previous MASS by switching to a song-masked pre-training strategy and a separate lyric-to-lyric and melody-to-melody encoder-decoder to ensure smoother lyric-to-melody and melody-to-lyric generation. A cited study proposes a two-melody self-supervised generation system that is neural-based and utilizes paired lyric-rhythm data. Some researchers have incorporated music theory and relationships between the lyrics, rhythm, and melody as well. Although these approaches have achieved relative reliability in their results and improvements, the models rely on significant amounts of prior training data, potentially increasing the computing power required to process large datasets. It also raises the question of improving neural-based models in modern-day AI, which is also related to scaling laws: is collecting more data the only method forward for technological advancements?
Lyric-to-Music Generation without Neural Networks
Few non-deep learning methods for lyric-to-music generation have been investigated. A cited study proposes a purely algorithmic composition algorithm that uses lyric-note correlations captured by frequent pattern mining on the song database to generate Probabilistic Automaton (PA) for melody composition. This method relies on data, neglecting pitch-lyric matching and alignment, and only considers tonal languages, raising concerns about stress and syllable grouping. A cited study introduces Markov chains for lyrics-to-melody generation, though challenges exist in maintaining high-level consistency due to local statistical similarities. A cited study introduces an algorithm that considers compositions in a method inclined towards using probability to achieve music generation, but there is not a strong emphasis on lyrical alignment and specific consideration on lyrical and language aspects such as stress.
We aim to directly generate a song from lyrics by using pure algorithms geared towards a composer’s intuition as well as non-neural-based approaches. Furthermore, we creatively leverage the relationship between keywords, stressed syllables, and stressed beats, as well as other statistical, rhythmic, and lyrical features found in, all of which are derived from patterns in music theory. The derived patterns are largely based on the intuition of composers and lyricists, mirroring our approach for the music core.
Image-to-Music Generation
Currently, image-to-music generation remain relatively unexplored. Research in this area involves deep learning methods that extract essential visual attributes, which are subsequently translated into melodies, harmonies, and rhythmic patterns. Emotion is heavily considered in various ways. Some utilize the Valence-Arousal (VA) emotional space to detect the emotional tone of an image, while other researchers perform image analysis while assuming that components are musically related. In general, all the works emphasize the potential emotions that could be extracted from the images. Recent research methodologies focus on generating audio music from multiple modalities, including images, and text. MelFusion synthesizes music from image and language cues using diffusion models. However, our image-to-music methodology distinguishes from these by utilizing LLM technologies to generate lyrics from an input image before employing the music core, our purely algorithmic lyric-to-music approach, to generate the corresponding music, reducing the need to specifically analyze emotions from the image.
Pitch Construction
When all the lyrics have been placed in their corresponding locations, the rhythmic structure is established for the song, and the pitch is considered. The parameters for the pitch construction are set up first. The key signature, pitch range, and phrase lengths are considered. The key signature not only establishes the mood and tone of the song, but also the appropriate notes for the major/Ionian or minor/Aeolian mode, which is also determined by the key (e.g., D major). As mentioned previously, our method allows users to choose their preferred key or select a random key, where the key containing the highest alignment with the melody (termed as key confidence in this paper) is chosen among a couple of randomly selected key signatures. A pitch range is constructed based on the selected key and kept within a certain comfortable singing range for most individuals. The phrase lengths are considered to gauge the approximate average number of measures used per phrase.
The parameters described above help the pitch generation process. This process is paired with pitch insertion, and the two processes are in a feedback loop until all pitches have been inserted into the score. The pitches would first be randomly generated but automatically adapted to music theory; then, they are inserted into the corresponding lyrics before multiple notes are adjusted by phrase to ensure a smoother connection between the notes and create a flowing melody. The degree of randomness would provide greater phrase variety even after pitch adjustment, thus preventing excess repetition that would facilitate less enjoyment.
XML Score Conversion
When the score construction is complete along with the pitch construction, the score is converted to MusicXML files for readability and easier usage in composition software and general audio/music notation software. Additionally, converting the completed score into MusicXML provides easier digital sheet music exchanges and collaborations. In the system, the MusicXML file is utilized to help display the sheet music upon the generation of non-lyrical music or a lyrical song.
GenAIM System Architecture
This MusicAIR framework is built on the Amazon Web Services (AWS) platform. It utilizes several services including networking and content delivery, application integration, database, storage, artificial intelligence, security, identity, and compliance. The core music generation module directly creates music from the input lyrics, producing both sheet music and audio files. The input image is processed by the LLMs of the AI service, which generate the lyrics. These generated lyrics are then passed to the music core for music composition. The front end web application loads the music files from the AWS cloud, renders to a music sheet, and plays the music.
Evaluation Metrics
Multiple metrics are used to evaluate the robustness of the system. The main metrics are key confidence, melodic smoothness, and rhythm matching. Key confidence evaluates key signature alignment with the generated melody, while melodic smoothness evaluates the degree of resemblance to human-composed melodies through the smoothness of a melody. Rhythm matching evaluates alignment between stressed beats and stressed lyrical elements and vice versa.
Melodic Smoothness
The direction change rate represents contour smoothness and counts how often the direction of the melody changes. Fewer direction changes correspond to a smoother and more flowing melody. The rate is normalized by the sequence length to get a relative value.
Experimental Results & Evaluation
We performed AI music generation with the web tool GenAIM using our proposed framework, MusicAIR, and conducted exploratory data analysis using Music21, a Python-based development toolkit created by the Massachusetts Institute of Technology (MIT), to discover potential similarities and differences between an AI-generated and an original composition. The toolkit has been established as robust for theory-based evaluations and is suitable for the field of algorithmic composition. Human listening evaluations are not included in this paper, as the core focus is on theory-based metrics and the background variability of listeners may create conclusions that are difficult to consolidate. Additionally, we seek to discover correlations and trends within each composition. The web tool GenAIM generates music from text and image forms, as seen in Figures 6 and 12. The algorithm-driven music core has no specific requirements for GPU/CPU models, the amount of memory, and the operating system. The GenAIM system is deployed on AWS, and only Python 3.0+ is used for implementation.
Two experiments are performed: 1) 24 original songs from children’s piano books are used for comparison with multiple AI-generated scores for each song; and 2) the evaluation metrics evaluate 517 generated music from the GenAIM database by anonymous users. Sections A to C cover the first experiment, and Section D covers the second experiment.
Comparison Metrics with User-Generated Songs
In this alternate experiment with 517 generated music from both lyrics and images by anonymous users, the same evaluation metrics are used. However, because the music originates from anonymous contributors and the lyrics or images have not previously been set to music, there are no original songs or music available for comparison. Figures 11(a), 11(b), and 11(c) display the corresponding violin plots for the average interval, the step ratio and direction change rate, and the key confidence, respectively. For median values, the average interval of 2.56 is still consistent with stepwise motion; the step ratio of 0.583 is close to the threshold 0.6 as well; the direction change rate of 0.571 also suggests that there is a relatively equal frequency of changing to different directions; and the key confidence value of 0.828 is similarly high, demonstrating high key signature alignment with the generated melodies. As a result, this indicates that GenAIM’s performance is consistent across all generated songs and aligns with theory-based evaluation benchmarks.
Conclusions & Future Work
We introduced MusicAIR, a state-of-the-art multimodal music generation framework powered by an algorithm-driven lyric-to-music generation core. The method supported by our framework enables music generation by integrating both lyrical and non-lyrical inputs, including text and images. Furthermore, the lyric-to-music generation process does not rely on prior training data. Comprehensive musical analysis performed through music21, a confirmed robust method of analysis and evaluation through music theory, compared the results of 97 AI-generated songs to the original human-composed songs, as well as evaluated 517 anonymously generated music from the GenAIM database. Our experimental findings demonstrate that the overall averaged key confidence values for the generated songs matching one original song reach 0.85 compared to 0.79 for the original, human-composed songs. The average rhythmic matching is 73.6% for all generated songs when compared with original songs. Furthermore, the anonymously generated songs demonstrate a 0.828 key confidence. Therefore, using MusicAIR, GenAIM is capable of generating highly fitting melodies rhythmically and melodically. Although human listening evaluations were not performed, we believe that evaluating based on music theory standards, an objective and reasonable nature, is more fitting for the research in this paper in particular than listening evaluations, as the main objective of our paper is to determine if GenAIM aligns with music theory rules. Overall, our novel method can inspire music generation techniques from a refreshing perspective. As our framework evolves, we believe our method will benefit both amateur and professional musicians as a copilot and an educational tutor and help accelerate the composition workflow and learning process by aspiring musicians.
Since this paper is solely focused on the generation of main melodies, no further musical complexity is added. For future work, the pitch construction can still be improved upon by adding more layers of complexity, such as including chord progressions and a variety of cadences. Furthermore, more experiments with different songwriting genres can be considered to present more diverse AI-generated works, which may impact both the rhythmic structure and pitch construction.
Limitations
One limitation of using LLMs to extract image information is that the process may lack contextual depth and creativity. Furthermore, our algorithm for generating music from lyrics currently does not have multiple variations for different moods and genres. These limitations will be improved upon and optimized in our future work.
Ethical Implications
Lyrics-to-music generation with deep learning poses ethical challenges. The proposed method does not use deep learning in the lyric-to-music process, but LLMs are utilized to analyze the image for music inspiration. LLMs help shape rhythmic structure but do not directly generate music, preventing copyright concerns and ensuring the AI-generated songs are original. All images, text, lyrics, and music samples used are either created by the authors or generated through their GenAIM web tool, eliminating copyright issues.


