Skip to content

matagno/sound-analyzer-note

Repository files navigation

Sound analyzer and decomposition into musical notes.

en fr

The objective of this project is to create an application capable of thoroughly analyzing a single-instrument sound and transcribing the played score. The sound to be analyzed can either be downloaded, recorded directly via the application, or digitally generated using the application. This is a typical example of a sound that is easy to analyze.

➤ Features:

  • Display of the amplitude spectrum
  • Fast Fourier Transform (FFT) calculation
  • Generation of the spectrogram (via sound decomposition using FFT)
  • Score generation with a treble clef
  • Digital generation of sound at multiple frequencies

🛠️ Installation and Dependencies

Requirements

  • Python 3.8+
  • NumPy
  • SciPy
  • Matplotlib
  • CustomTkinter
  • Pillow (PIL)
  • PyAudio

Installation

pip install numpy scipy matplotlib customtkinter pillow pyaudio

🧑🏻‍💻 Usage

Home

Analyzer Tab - Analyze audio files to visualize their spectral content:

  1. Click "Select File" to choose an audio file (.wav format recommended)
  2. Toggle "Stereo file" if analyzing a stereo file and select the desired track
  3. Use the "Freq Max" field to set the maximum frequency display
  4. Click "Analyse" to view the amplitude spectrum and spectrogram

FFT Analysis - Perform a Fast Fourier Transform on a specific time interval:

  1. Set "Début" (start time in seconds)
  2. Set "Durée" (duration in seconds)
  3. Click "FFT" to display the frequency spectrum

Note Detection - Display detected musical notes in a staff:

  1. Set "Durée d'un ton" (time window for note detection)
  2. Click "Note" to visualize the detected notes

Generate Sound

Create synthetic audio signals:

  1. Enter the audio name (without extension)
  2. Set Fs (sampling frequency in Hz) - typically 44100
  3. Set t (duration in seconds)
  4. Set A1 (amplitude in Pa)
  5. Set F1 (frequency in Hz)
  6. Click "Create" to generate the .wav file

The generated audio will be saved in the Sound/ folder and appear in the file list.

Audio recording

Record audio directly from your microphone:

  1. Navigate to the "Recorder" tab
  2. Click the microphone button to start recording
  3. Click again to stop recording

The recording will be saved as Sound/recorded_audio.wav

📊 Project Structure

├── AnalyzerApp.py          # Main application GUI
├── SpectreGenerator.py      # FFT and spectrum visualization functions
├── SoundGenerator.py        # Audio generation and recording functions
├── Sound/                   # Generated and recorded audio files
├── interface_images/        # UI icons and images
└── demo_img/               # Demo screenshots for documentation

📸 Screenshots

Analyzer

Analyzer View

Note Detection

Note Detection

Sound Generator

Generator View

Audio Recorder

Recorder View

About

Sound analyzer and decomposition into musical notes.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages