While high-density Brain-Computer Interfaces (BCIs) excel in emotion recognition and Large Lan- guage Models (LLMs) revolutionize music generation, their intersection for emotion-conditioned co-composition remains largely unexplored. Current audio AI predominantly acts as an opaque black box, inducing “replacement anxiety” by isolating users from the creative process. Address- ing this gap, we introduce the NeuroMusic Composer, a multimodal framework establishing a symbiotic, transparent loop between a consumer-grade BCI and an LLM. The pipeline captures brain signals via a 4-channel Interaxon Muse 2 headset. An advanced emotion recognition frame- work processes these sparse EEG signals using Foundation Models (FMs), injecting the detected affective state as dynamic context into an LLM. Functioning as a Cognitive Reasoning Layer, the LLM translates abstract emotional inputs into rigorous harmonic parameters, generating fully interpretable, emotion-conditioned symbolic music scores rendered in real-time via the Max/MSP bach library. Empirical evaluations yielded significant breakthroughs. To overcome hardware constraints in the EEG domain, an extensive benchmark of state-of-the-art EEG FMs (including REVE, BIOT, CBraMod, LUNA, SignalJEPA, LaBraM, and EEGPT) was conducted on NeuroSense, a novel sparse-electrode dataset, under a full fine-tuning regime. The topology-agnostic LUNA architecture emerged as the optimal solution for sparse configurations. Validated across the four quadrants of Russell’s circumplex model, the framework demonstrated exceptional affective generalization across a 30-subject cohort. It achieved a global mean accuracy of 80.17% (± 10.00%) for Quadrant I (Excited), and a highly consistent 83.00% (± ∼10.33%) average for the remaining quadrants (Angry, Sad, Relaxed). Remarkably, despite this natural biological variance, the system reached individual peak accuracies of 97% in Quadrant I, and a perfect 100% in Quadrants II, III, and IV. Furthermore, the analysis demonstrated that Parameter-Efficient Fine- Tuning (LoRA) matches full fine-tuning efficacy, whereas generative spatial upsampling (ZUNA) caused a statistically significant performance degradation compared to standard geometric interpolation. To bridge the modality gap on the generative front, advanced prompt paradigms were developed and evaluated by an instructed LLM Judge. Results confirmed that leading LLMs from the Claude, Gemini, and GPT families can successfully compose music conditioned by affective labels, seamlessly embedding personalized creative signatures through customized user prompts. Moreover, the analysis confirmed that combining RE2 (Re-Reading) logic with Dynamic Few-Shot conditioning successfully eradicates structural hallucinations. Crucially, the implementation of a Chain-of-Thought (CoT) Composer’s Diary countered the inherent generative “laziness” and monotonicity of LLMs. This approach empowered high-capacity models to perform algorithmic self-correction, maximizing creative potential while guaranteeing Explainable AI (XAI) transparency. Ultimately, this research shifts the paradigm from uncontrolled algorithmic generation to a glass-box ecosystem of emotion-conditioned, manipulable music composition, cementing a true symbiosis between human intent and artificial intelligence.

While high-density Brain-Computer Interfaces (BCIs) excel in emotion recognition and Large Lan- guage Models (LLMs) revolutionize music generation, their intersection for emotion-conditioned co-composition remains largely unexplored. Current audio AI predominantly acts as an opaque black box, inducing “replacement anxiety” by isolating users from the creative process. Address- ing this gap, we introduce the NeuroMusic Composer, a multimodal framework establishing a symbiotic, transparent loop between a consumer-grade BCI and an LLM. The pipeline captures brain signals via a 4-channel Interaxon Muse 2 headset. An advanced emotion recognition frame- work processes these sparse EEG signals using Foundation Models (FMs), injecting the detected affective state as dynamic context into an LLM. Functioning as a Cognitive Reasoning Layer, the LLM translates abstract emotional inputs into rigorous harmonic parameters, generating fully interpretable, emotion-conditioned symbolic music scores rendered in real-time via the Max/MSP bach library. Empirical evaluations yielded significant breakthroughs. To overcome hardware constraints in the EEG domain, an extensive benchmark of state-of-the-art EEG FMs (including REVE, BIOT, CBraMod, LUNA, SignalJEPA, LaBraM, and EEGPT) was conducted on NeuroSense, a novel sparse-electrode dataset, under a full fine-tuning regime. The topology-agnostic LUNA architecture emerged as the optimal solution for sparse configurations. Validated across the four quadrants of Russell’s circumplex model, the framework demonstrated exceptional affective generalization across a 30-subject cohort. It achieved a global mean accuracy of 80.17% (± 10.00%) for Quadrant I (Excited), and a highly consistent 83.00% (± ∼10.33%) average for the remaining quadrants (Angry, Sad, Relaxed). Remarkably, despite this natural biological variance, the system reached individual peak accuracies of 97% in Quadrant I, and a perfect 100% in Quadrants II, III, and IV. Furthermore, the analysis demonstrated that Parameter-Efficient Fine- Tuning (LoRA) matches full fine-tuning efficacy, whereas generative spatial upsampling (ZUNA) caused a statistically significant performance degradation compared to standard geometric interpolation. To bridge the modality gap on the generative front, advanced prompt paradigms were developed and evaluated by an instructed LLM Judge. Results confirmed that leading LLMs from the Claude, Gemini, and GPT families can successfully compose music conditioned by affective labels, seamlessly embedding personalized creative signatures through customized user prompts. Moreover, the analysis confirmed that combining RE2 (Re-Reading) logic with Dynamic Few-Shot conditioning successfully eradicates structural hallucinations. Crucially, the implementation of a Chain-of-Thought (CoT) Composer’s Diary countered the inherent generative “laziness” and monotonicity of LLMs. This approach empowered high-capacity models to perform algorithmic self-correction, maximizing creative potential while guaranteeing Explainable AI (XAI) transparency. Ultimately, this research shifts the paradigm from uncontrolled algorithmic generation to a glass-box ecosystem of emotion-conditioned, manipulable music composition, cementing a true symbiosis between human intent and artificial intelligence.

CAN HUMANS CO-COMPOSE WITH LLMS? AN EMOTION-DRIVEN NEUROMUSIC COMPOSER INTEGRATING CONSUMER-GRADE BCIS AND EEG FOUNDATION MODELS

FOGLIA, MAURO
2025/2026

Abstract

While high-density Brain-Computer Interfaces (BCIs) excel in emotion recognition and Large Lan- guage Models (LLMs) revolutionize music generation, their intersection for emotion-conditioned co-composition remains largely unexplored. Current audio AI predominantly acts as an opaque black box, inducing “replacement anxiety” by isolating users from the creative process. Address- ing this gap, we introduce the NeuroMusic Composer, a multimodal framework establishing a symbiotic, transparent loop between a consumer-grade BCI and an LLM. The pipeline captures brain signals via a 4-channel Interaxon Muse 2 headset. An advanced emotion recognition frame- work processes these sparse EEG signals using Foundation Models (FMs), injecting the detected affective state as dynamic context into an LLM. Functioning as a Cognitive Reasoning Layer, the LLM translates abstract emotional inputs into rigorous harmonic parameters, generating fully interpretable, emotion-conditioned symbolic music scores rendered in real-time via the Max/MSP bach library. Empirical evaluations yielded significant breakthroughs. To overcome hardware constraints in the EEG domain, an extensive benchmark of state-of-the-art EEG FMs (including REVE, BIOT, CBraMod, LUNA, SignalJEPA, LaBraM, and EEGPT) was conducted on NeuroSense, a novel sparse-electrode dataset, under a full fine-tuning regime. The topology-agnostic LUNA architecture emerged as the optimal solution for sparse configurations. Validated across the four quadrants of Russell’s circumplex model, the framework demonstrated exceptional affective generalization across a 30-subject cohort. It achieved a global mean accuracy of 80.17% (± 10.00%) for Quadrant I (Excited), and a highly consistent 83.00% (± ∼10.33%) average for the remaining quadrants (Angry, Sad, Relaxed). Remarkably, despite this natural biological variance, the system reached individual peak accuracies of 97% in Quadrant I, and a perfect 100% in Quadrants II, III, and IV. Furthermore, the analysis demonstrated that Parameter-Efficient Fine- Tuning (LoRA) matches full fine-tuning efficacy, whereas generative spatial upsampling (ZUNA) caused a statistically significant performance degradation compared to standard geometric interpolation. To bridge the modality gap on the generative front, advanced prompt paradigms were developed and evaluated by an instructed LLM Judge. Results confirmed that leading LLMs from the Claude, Gemini, and GPT families can successfully compose music conditioned by affective labels, seamlessly embedding personalized creative signatures through customized user prompts. Moreover, the analysis confirmed that combining RE2 (Re-Reading) logic with Dynamic Few-Shot conditioning successfully eradicates structural hallucinations. Crucially, the implementation of a Chain-of-Thought (CoT) Composer’s Diary countered the inherent generative “laziness” and monotonicity of LLMs. This approach empowered high-capacity models to perform algorithmic self-correction, maximizing creative potential while guaranteeing Explainable AI (XAI) transparency. Ultimately, this research shifts the paradigm from uncontrolled algorithmic generation to a glass-box ecosystem of emotion-conditioned, manipulable music composition, cementing a true symbiosis between human intent and artificial intelligence.
2025
CAN HUMANS CO-COMPOSE WITH LLMS? AN EMOTION-DRIVEN NEUROMUSIC COMPOSER INTEGRATING CONSUMER-GRADE BCIS AND EEG FOUNDATION MODELS
While high-density Brain-Computer Interfaces (BCIs) excel in emotion recognition and Large Lan- guage Models (LLMs) revolutionize music generation, their intersection for emotion-conditioned co-composition remains largely unexplored. Current audio AI predominantly acts as an opaque black box, inducing “replacement anxiety” by isolating users from the creative process. Address- ing this gap, we introduce the NeuroMusic Composer, a multimodal framework establishing a symbiotic, transparent loop between a consumer-grade BCI and an LLM. The pipeline captures brain signals via a 4-channel Interaxon Muse 2 headset. An advanced emotion recognition frame- work processes these sparse EEG signals using Foundation Models (FMs), injecting the detected affective state as dynamic context into an LLM. Functioning as a Cognitive Reasoning Layer, the LLM translates abstract emotional inputs into rigorous harmonic parameters, generating fully interpretable, emotion-conditioned symbolic music scores rendered in real-time via the Max/MSP bach library. Empirical evaluations yielded significant breakthroughs. To overcome hardware constraints in the EEG domain, an extensive benchmark of state-of-the-art EEG FMs (including REVE, BIOT, CBraMod, LUNA, SignalJEPA, LaBraM, and EEGPT) was conducted on NeuroSense, a novel sparse-electrode dataset, under a full fine-tuning regime. The topology-agnostic LUNA architecture emerged as the optimal solution for sparse configurations. Validated across the four quadrants of Russell’s circumplex model, the framework demonstrated exceptional affective generalization across a 30-subject cohort. It achieved a global mean accuracy of 80.17% (± 10.00%) for Quadrant I (Excited), and a highly consistent 83.00% (± ∼10.33%) average for the remaining quadrants (Angry, Sad, Relaxed). Remarkably, despite this natural biological variance, the system reached individual peak accuracies of 97% in Quadrant I, and a perfect 100% in Quadrants II, III, and IV. Furthermore, the analysis demonstrated that Parameter-Efficient Fine- Tuning (LoRA) matches full fine-tuning efficacy, whereas generative spatial upsampling (ZUNA) caused a statistically significant performance degradation compared to standard geometric interpolation. To bridge the modality gap on the generative front, advanced prompt paradigms were developed and evaluated by an instructed LLM Judge. Results confirmed that leading LLMs from the Claude, Gemini, and GPT families can successfully compose music conditioned by affective labels, seamlessly embedding personalized creative signatures through customized user prompts. Moreover, the analysis confirmed that combining RE2 (Re-Reading) logic with Dynamic Few-Shot conditioning successfully eradicates structural hallucinations. Crucially, the implementation of a Chain-of-Thought (CoT) Composer’s Diary countered the inherent generative “laziness” and monotonicity of LLMs. This approach empowered high-capacity models to perform algorithmic self-correction, maximizing creative potential while guaranteeing Explainable AI (XAI) transparency. Ultimately, this research shifts the paradigm from uncontrolled algorithmic generation to a glass-box ecosystem of emotion-conditioned, manipulable music composition, cementing a true symbiosis between human intent and artificial intelligence.
File in questo prodotto:
File Dimensione Formato  
Tesi_ESSE3-compressed.pdf

non disponibili

Descrizione: Tesi - Finale
Dimensione 4.99 MB
Formato Adobe PDF
4.99 MB Adobe PDF

I documenti in UNITESI sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/20.500.14253/66140