Emotionally consistent music melody generation algorithm integrating prompt perception and hyper-network optimization

This paper proposes a stable emotion-consistent music melody generation algorithm (ECM-HPO) that integrates cue-awareness and hyper-network optimization. The algorithm is optimized to address three core challenges in intelligent melody generation: emotion consistency defects, insufficient understanding of user intent, and dynamic adaptability limitations. The algorithm contains three core innovations: (1) Emotion consistency enhancement mechanism. The algorithm constructs a unified emotion space by combining audio features, text cues, and historical melody windows, and optimizes the macro-emotional profile and micro-note expression based on differentiable music theory constraints; (2) Cue-aware melody-guided generation module. The algorithm establishes a unified encoding framework for heterogeneous cues and uses multi-scale cross-attention to achieve semantic alignment. At the same time, the cue vector is injected into the generation process as prior information through a conditional decoder; (3) Hyper-network-optimized dynamic generation architecture. The algorithm adopts a three-level hyper-network (context-aware → parameter generation → dynamic loading) to achieve on-demand prediction of generator weights. At the same time, the model introduces a music-specific search space to take into account music theory constraints such as harmony and rhythm density. Experiments on the constructed EMD-Melody dataset show that ECM-HPO significantly outperforms baseline methods (TGM, Transformer, EAM, CDM, and LSOTAM) in multiple indicators. Numerical results show excellent performances of melody contour smoothness (PCS) of 0.910, rhythm consistency (RC) of 0.891, and emotion recognition accuracy (ERA) of 92.4%. Ablation experiments verify the contribution of each module and the PCS of the complete model is improved by 15.19% compared with the basic model. Cross-style tests further confirm the robustness of the algorithm.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2025-12-18
DOI
https://doi.org/10.1038/s41598-025-21571-9
Citations
1
Primary Topic
Music Technology and Sound Studies
Type
article
Field-Weighted Citation Impact
1.28
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Emotionally consistent music melody generation algorithm integrating prompt perception and hyper-network optimization

Qiang Feng
1 citations
Scientific Reports
Music Technology and Sound Studies
1.28
article

Emotionally consistent music melody generation algorithm integrating prompt perception and hyper-network optimization

Qiang Feng
article en
1 citations

Abstract

This paper proposes a stable emotion-consistent music melody generation algorithm (ECM-HPO) that integrates cue-awareness and hyper-network optimization. The algorithm is optimized to address three core challenges in intelligent melody generation: emotion consistency defects, insufficient understanding of user intent, and dynamic adaptability limitations. The algorithm contains three core innovations: (1) Emotion consistency enhancement mechanism. The algorithm constructs a unified emotion space by combining audio features, text cues, and historical melody windows, and optimizes the macro-emotional profile and micro-note expression based on differentiable music theory constraints; (2) Cue-aware melody-guided generation module. The algorithm establishes a unified encoding framework for heterogeneous cues and uses multi-scale cross-attention to achieve semantic alignment. At the same time, the cue vector is injected into the generation process as prior information through a conditional decoder; (3) Hyper-network-optimized dynamic generation architecture. The algorithm adopts a three-level hyper-network (context-aware → parameter generation → dynamic loading) to achieve on-demand prediction of generator weights. At the same time, the model introduces a music-specific search space to take into account music theory constraints such as harmony and rhythm density. Experiments on the constructed EMD-Melody dataset show that ECM-HPO significantly outperforms baseline methods (TGM, Transformer, EAM, CDM, and LSOTAM) in multiple indicators. Numerical results show excellent performances of melody contour smoothness (PCS) of 0.910, rhythm consistency (RC) of 0.891, and emotion recognition accuracy (ERA) of 92.4%. Ablation experiments verify the contribution of each module and the PCS of the complete model is improved by 15.19% compared with the basic model. Cross-style tests further confirm the robustness of the algorithm.

Scientific ReportsVol. 15(1)
Jiaozuo University (CN)
Openalex Percentile: Top 14%
Music Technology and Sound Studies
1.28
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.