The designed software converts vocal audio files into MIDI scores that can be played on a Yamaha Disklavier piano. The audio signal can be generated using a speech synthesis system integrated into the program or imported from an external file. The software was designed and tested using English-language vocal audio files. The MIDI protocol is a communication language that enables the exchange of messages between electronic instruments, computers, and other devices. The exchanged messages describe musical events such as note-on and note-off actions, velocity, and other expressive controls. To describe a musical event within the input signal—such as the occurrence of a note—one must know its pitch, velocity, start time, and duration. The process of signal analysis and MIDI score construction consists of the following stages: 1. Signal analysis using the Short-Time Fourier Transform (STFT) to obtain a description in both the frequency and time domains. 2. Spectrogram analysis: the most significant spectral peaks (those with the greatest amplitude) are identified, and information is extracted to determine note pitch, velocity, and duration, allowing for the description of all musical events present in the signal. 3. MIDI score creation: the identified musical events are compiled into a single MIDI file. The STFT is the transform applied to the signal that enables us to derive all the information needed to construct the MIDI file, it analyzes the signal using successive time windows, thereby allowing the evolution of its spectral content over time to be described. Unlike the Discrete Fourier Transform (DFT), the signal is not analyzed in its entirety; instead, it is divided into partially overlapping segments called frames, to which the DFT is applied. The interval between the start times of two consecutive frames is known as the "hop size." A window—a function that eliminates potential discontinuities at the edges of each frame—is applied to the signal. The type and size of the window determine a trade-off between temporal and frequency resolution in the resulting spectrum: large windows yield higher temporal resolution, while small windows yield higher frequency resolution. The Librosa library was used to analyze the signal—specifically the "load," "stft," and "fft_frequencies" functions—to convert the input signal into a numerical sequence, apply the STFT to the signal, and track the frequencies corresponding to the "bins" into which the frequency spectrum was divided. The MIDI standard defines note pitch and velocity using specific numbers—both integers ranging from 0 to 127. Once the most significant peaks for each frame are identified, the corresponding pitch and velocity values ​​are determined. To accurately describe all musical events in the signal, the start time and duration of each note are defined by identifying all "note-on" and "note-off" events, this involves defining the duration and start time of each frame, analyzing the entire signal frame by frame, and tracking notes using a list of active notes with any notes still active at the end of the final frame being "closed." At this stage, each note is associated with its pitch value, velocity value, and "note-on" and "note-off" events. The resulting events are compiled into a single musical score, which is the output of the process.

Il software progettato trasforma file audio vocali in partiture MIDI eseguibili su un pianoforte Yamaha Disklavier. Il segnale audio può essere generato mediante un sistema di sintesi vocale integrato nel programma oppure importato da un file esterno. Il software è stato progettato e testato utilizzando file audio vocali in lingua inglese. Il protocollo MIDI è un linguaggio di comunicazione che consente lo scambio di messaggi tra strumenti elettronici, computer e altri dispositivi. I messaggi scambiati descrivono eventi musicali come l'attivazione e rilascio di una nota, la velocity o altri controlli espressivi. Per descrivere un evento musicale presente nel segnale in input, come per esempio la presenza di una nota, bisogna essere a conoscenza della sua altezza, della velocity, dell'istante di inizio e della sua durata. Il processo di analisi del segnale e costruzione della partitura MIDI si compone delle seguenti fasi: 1.Analisi del segnale mediante applicazione della Short-Time Fourier Transform (STFT), per ottenerne una descrizione del dominio frequenziale e temporale. 2.Analisi dello spettrogramma: vengono individuati i picchi dello spettro più significativi (ovvero quelli con ampiezza maggiore) e vengono estratte le informazioni per determinare altezza, velocity e durata delle note,con cui possono essere descritti tutti gli eventi musicali presenti nel segnale 3.Creazione della partitura MIDI: gli eventi musicali individuati vengono raccolti in un unico file MIDI La STFT è la trasformata che applichiamo al segnale e che ci premette di ricavare tutte le informazioni necessarie per costruire il file MIDI, la trasformata analizza il segnale mediante finestre temporali successive e permette quindi di descrivere l'evoluzione nel tempo del suo contenuto spettrale, a differenza della Discrete Fourier transform (DFT) il segnale non è analizzato per intero, ma questo viene diviso in porzioni parzialmente sovrapposte chiamate frame, a cui viene applicata la DFT, la distanza tra l'istante di inizio di due frame consecutivi è detta hop-size. Al segnale viene applicata una window, una funzione che elimina eventuali discontinuità alle estremità di ciascun frame, il tipo di window utilizzata e la sua dimensione determinano un compromesso tra risoluzione temporale e frequenziale nello spettro ottenuto: finestre grandi portano ad una maggiore risoluzione temporale, finestre piccole ad una maggiore risoluzione freqeunziale. Per analizzare il segnale è stata utilizzata la libreria Librosa, in particolare le funzioni: “load”,”stft” e “fft_frequencies”, usate rispettivamente per: convertire il segnale in input in una sequenza numerica, applicare la STFT al segnale e tenere traccia delle frequenze relative ai “bin” in cui è stato suddiviso lo spettro delle frequenze. Lo standard MIDI identifica l'altezza delle note e la velocity attraverso un numero di nota e un numero di velocity,entrambi interi e compresi tra 0 e 127. Una volta individuati i picchi più significativi per ogni frame, si determinano i rispettivi numeri di nota e velocity. Per descrivere correttamente tutti gli eventi musicali presenti nel segnale si definiscono l'istante di inizio e la durata di ciascuna nota, individuando tutti gli eventi note on e note off, per fare ciò definiamo la durata e l'istante di inizio di ogni frame, analizziamo l'intero segnale frame per frame e teniamo traccia delle note utilizzando una lista di note attive, una volta analizzato l'ultimo frame “chiudiamo” eventuali note ancora attive. A questo punto ad ogni nota è associato il proprio numero di altezza, numero di velocity e gli eventi note on e note off. Gli eventi ottenuti vengono raccolti in un unica partitura restituita in output.

Progetto e sviluppo di software per l'analisi nel dominio frequenziale di file audio vocali e generazione di file MIDI destinato alla riproduzione su pianoforte Yamaha Disklavier

RIGON, ANGELO DOMENICO
2025/2026

Abstract

The designed software converts vocal audio files into MIDI scores that can be played on a Yamaha Disklavier piano. The audio signal can be generated using a speech synthesis system integrated into the program or imported from an external file. The software was designed and tested using English-language vocal audio files. The MIDI protocol is a communication language that enables the exchange of messages between electronic instruments, computers, and other devices. The exchanged messages describe musical events such as note-on and note-off actions, velocity, and other expressive controls. To describe a musical event within the input signal—such as the occurrence of a note—one must know its pitch, velocity, start time, and duration. The process of signal analysis and MIDI score construction consists of the following stages: 1. Signal analysis using the Short-Time Fourier Transform (STFT) to obtain a description in both the frequency and time domains. 2. Spectrogram analysis: the most significant spectral peaks (those with the greatest amplitude) are identified, and information is extracted to determine note pitch, velocity, and duration, allowing for the description of all musical events present in the signal. 3. MIDI score creation: the identified musical events are compiled into a single MIDI file. The STFT is the transform applied to the signal that enables us to derive all the information needed to construct the MIDI file, it analyzes the signal using successive time windows, thereby allowing the evolution of its spectral content over time to be described. Unlike the Discrete Fourier Transform (DFT), the signal is not analyzed in its entirety; instead, it is divided into partially overlapping segments called frames, to which the DFT is applied. The interval between the start times of two consecutive frames is known as the "hop size." A window—a function that eliminates potential discontinuities at the edges of each frame—is applied to the signal. The type and size of the window determine a trade-off between temporal and frequency resolution in the resulting spectrum: large windows yield higher temporal resolution, while small windows yield higher frequency resolution. The Librosa library was used to analyze the signal—specifically the "load," "stft," and "fft_frequencies" functions—to convert the input signal into a numerical sequence, apply the STFT to the signal, and track the frequencies corresponding to the "bins" into which the frequency spectrum was divided. The MIDI standard defines note pitch and velocity using specific numbers—both integers ranging from 0 to 127. Once the most significant peaks for each frame are identified, the corresponding pitch and velocity values ​​are determined. To accurately describe all musical events in the signal, the start time and duration of each note are defined by identifying all "note-on" and "note-off" events, this involves defining the duration and start time of each frame, analyzing the entire signal frame by frame, and tracking notes using a list of active notes with any notes still active at the end of the final frame being "closed." At this stage, each note is associated with its pitch value, velocity value, and "note-on" and "note-off" events. The resulting events are compiled into a single musical score, which is the output of the process.
2025
Software development for frequency-domain analysis of vocal audio files and the generation of MIDI files for playback on a Yamaha Disklavier piano
Il software progettato trasforma file audio vocali in partiture MIDI eseguibili su un pianoforte Yamaha Disklavier. Il segnale audio può essere generato mediante un sistema di sintesi vocale integrato nel programma oppure importato da un file esterno. Il software è stato progettato e testato utilizzando file audio vocali in lingua inglese. Il protocollo MIDI è un linguaggio di comunicazione che consente lo scambio di messaggi tra strumenti elettronici, computer e altri dispositivi. I messaggi scambiati descrivono eventi musicali come l'attivazione e rilascio di una nota, la velocity o altri controlli espressivi. Per descrivere un evento musicale presente nel segnale in input, come per esempio la presenza di una nota, bisogna essere a conoscenza della sua altezza, della velocity, dell'istante di inizio e della sua durata. Il processo di analisi del segnale e costruzione della partitura MIDI si compone delle seguenti fasi: 1.Analisi del segnale mediante applicazione della Short-Time Fourier Transform (STFT), per ottenerne una descrizione del dominio frequenziale e temporale. 2.Analisi dello spettrogramma: vengono individuati i picchi dello spettro più significativi (ovvero quelli con ampiezza maggiore) e vengono estratte le informazioni per determinare altezza, velocity e durata delle note,con cui possono essere descritti tutti gli eventi musicali presenti nel segnale 3.Creazione della partitura MIDI: gli eventi musicali individuati vengono raccolti in un unico file MIDI La STFT è la trasformata che applichiamo al segnale e che ci premette di ricavare tutte le informazioni necessarie per costruire il file MIDI, la trasformata analizza il segnale mediante finestre temporali successive e permette quindi di descrivere l'evoluzione nel tempo del suo contenuto spettrale, a differenza della Discrete Fourier transform (DFT) il segnale non è analizzato per intero, ma questo viene diviso in porzioni parzialmente sovrapposte chiamate frame, a cui viene applicata la DFT, la distanza tra l'istante di inizio di due frame consecutivi è detta hop-size. Al segnale viene applicata una window, una funzione che elimina eventuali discontinuità alle estremità di ciascun frame, il tipo di window utilizzata e la sua dimensione determinano un compromesso tra risoluzione temporale e frequenziale nello spettro ottenuto: finestre grandi portano ad una maggiore risoluzione temporale, finestre piccole ad una maggiore risoluzione freqeunziale. Per analizzare il segnale è stata utilizzata la libreria Librosa, in particolare le funzioni: “load”,”stft” e “fft_frequencies”, usate rispettivamente per: convertire il segnale in input in una sequenza numerica, applicare la STFT al segnale e tenere traccia delle frequenze relative ai “bin” in cui è stato suddiviso lo spettro delle frequenze. Lo standard MIDI identifica l'altezza delle note e la velocity attraverso un numero di nota e un numero di velocity,entrambi interi e compresi tra 0 e 127. Una volta individuati i picchi più significativi per ogni frame, si determinano i rispettivi numeri di nota e velocity. Per descrivere correttamente tutti gli eventi musicali presenti nel segnale si definiscono l'istante di inizio e la durata di ciascuna nota, individuando tutti gli eventi note on e note off, per fare ciò definiamo la durata e l'istante di inizio di ogni frame, analizziamo l'intero segnale frame per frame e teniamo traccia delle note utilizzando una lista di note attive, una volta analizzato l'ultimo frame “chiudiamo” eventuali note ancora attive. A questo punto ad ogni nota è associato il proprio numero di altezza, numero di velocity e gli eventi note on e note off. Gli eventi ottenuti vengono raccolti in un unica partitura restituita in output.
Sviluppo Sofware
Analisi frequenziale
Generazione MIDI
File in questo prodotto:
File Dimensione Formato  
presentazione tesi rigon a.pdf

accesso aperto

Dimensione 754.56 kB
Formato Adobe PDF
754.56 kB Adobe PDF Visualizza/Apri

The text of this website © Università degli studi di Padova. Full Text are published under a non-exclusive license. Metadata are under a CC0 License

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