Skip to main content

Python toolbox for sound analysis, resynthesis, and visual/symbolic representations.

Project description

AudioSpylt Logo

AudioSpylt

Note: This package is currently under development. The provided version should be treated as an alpha release.

AudioSpylt is a Python-based toolbox designed for sound analysis, resynthesis, and a variety of visual and symbolic sound representations. While it is primarily intended for instructional purposes, this toolbox seamlessly integrates with the Jupyter Notebook environment. Originally created for composition students, it places a special emphasis on diverse resynthesis techniques.

Update alpha-0.5

  • Major cleanup of the entire repository.
  • All conference-related resources (presentations, examples, posters) have been moved to the conferences/ folder. This includes dedicated folders for GMTH23, INMUSIC24, and MEC2025.
  • The exploration_of_timbre/ directory has been moved to conferences/inmusic24/ for reference. Further development will continue at egorpol/FFTimbre.

Update alpha-0.4

  • Improved and refactored MEI implementation, including quarter-tone and eighth-tonal representations, as well as basic support for temporal structure representation. Added SVG export. Check the symbolic_mei.ipynb notebook for more details.
  • Improved and refactored Python scripts for plotting TSV frequency tables and SSM representations (multiplotter.py and ssm.py).

Update alpha-0.3

  • Added the exploration_of_timbre/ directory with various experimental ML-based sound generation approaches using global optimization algorithms. The primary goal is to synthesize a DFT frame within a restricted FM/AM setup, optionally for use within Ableton Operator.
  • spectral_fm3.ipynb - Notebook for FM-based sound approximation using a single DFT frame as the source.
  • spectral_am3.ipynb - Notebook for AM-based sound approximation using a single DFT frame as the source.
  • operator_fm.ipynb - Notebook for adjusting calculated FM values to the Ableton Operator preset format.
  • operator_am.ipynb - Notebook for adjusting calculated AM values to the Ableton Operator preset format.
  • operator_preset_editor_fm.ipynb - Notebook for extracting and saving Ableton Operator presets in .adv format (its native preset format).
  • optimization_gif.ipynb - Notebook for creating learning process visualizations for different optimization algorithms.
  • distances_demo.ipynb - Notebook for visualizing distances of different objective functions.

Update alpha-0.2

Refactoring

  • All code has been refactored.
  • All Python scripts have been moved to the py_scripts/ folder.

Tutorials Added

All tutorials can be found in the tutorials/ folder:

  • mfcc_bank.ipynb - Brief introduction to MFCC-based sound representations.
  • peaks_scipy_showcase.ipynb - Quick introduction to the find_peaks function from scipy.signal, used for DFT-based peak filtering.
  • showcase_bayle.ipynb, showcase_noanoa.ipynb, showcase_parm.ipynb - Various examples of DFT-based peak detection and resynthesis, aiming to extract symbolic representations from sounds and resynthesize DFT frames for aural judgment and exploration of the analyzed audio.
  • above_nyquist.ipynb - Brief introduction to the effects of aliasing.
  • dft_resolution.ipynb - Brief introduction to the effects of sampling rate and sample length on DFT resolution.

Notebooks Added/Revised

  • symbolic_mei.ipynb - Completely rewritten implementation of Verovio-based MEI rendering (see also mei.py in the py_scripts/ folder). Now supports various rendering modes, including MIDI cent deviation notation above notes (useful for microtonal analysis).
  • ssm.ipynb - Plotly-based self-similarity matrix (SSM) visualization of selected audio files; includes analysis methods such as 'chroma', 'mfcc', or 'chroma+mfcc'.

Important Resources

  • Slides from the 23rd GMTH Congress talk can be found in the gmth_congress_slides/ folder.

Toolbox Overview

The toolbox is organized into the following main categories:

Instructional Notebooks

These notebooks provide comprehensive explanations and demonstrations of core audio concepts:

  • wave_sampling_window:
    • Covers sampling rate, Nyquist frequency, and window functions.
    • Discusses the implications of sampled material length on frequency resolution.
  • wave_vs_dft_3d:
    • Displays 2D and 3D representations of DFT spectra.
    • Emphasizes sine/cosine component visuals.

Analysis Notebooks

  • audio_load_dft:
    • Incorporates basic audio editing functions such as trim and fade.
    • Offers customizable peak detection methods.
    • Features thresholding functions and splits analyzed data into multiple DFTs.

Visualizations and Symbolic Rendering

  • visual_tsv:
    • Plotting scripts for data from TSV files and pandas DataFrames.
  • symbolic_mei:
    • Symbolic visualizations tailored for data from TSV files or pandas DataFrames.

TSV Manipulations and Resynthesis

  • df_pitch_stretch:
    • Implements pitch/stretch alterations on time-domain data stored in TSV files.
  • 2df_copypaste, 2df_merge:
    • Executes freeze effects and various kinds of spectral interpolation.
  • resynth:
    • Resynthesizes audio based on time-domain data from TSV files.

Getting Started

To get started, clone this repository and set up your Jupyter Notebook environment to run the notebooks.

Development install (recommended for testing notebooks)

To make import audiospylt work from anywhere (including notebooks/*.ipynb), do an editable install from the repo root.

In PowerShell (Windows):

cd C:\Users\egorp\Nextcloud\code\public_repos\audiospylt
python -m pip install -U pip
python -m pip install -e ".[notebook]"

Important: your Jupyter kernel must use the same Python environment where you ran the install. If you still see ModuleNotFoundError: No module named 'audiospylt', you’re almost certainly running the notebook in a different kernel.

Dependencies

AudioSpylt requires the following Python libraries:

  • IPython
  • librosa
  • matplotlib
  • numpy
  • pandas
  • plotly
  • requests
  • scipy
  • soundfile
  • tqdm
  • verovio

Installation

To install the dependencies, navigate to the root directory of the project and run:

pip install -r requirements.txt

Installation (pip package)

For local development (editable install from this repo):

pip install -e ".[notebook]"

After the project is published to PyPI:

pip install audiospylt

Contributions

Your contributions are welcome! Feel free to enhance the project through pull requests or by opening issues.

License

AudioSpylt is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiospylt-0.6.0a0.tar.gz (66.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiospylt-0.6.0a0-py3-none-any.whl (67.0 kB view details)

Uploaded Python 3

File details

Details for the file audiospylt-0.6.0a0.tar.gz.

File metadata

  • Download URL: audiospylt-0.6.0a0.tar.gz
  • Upload date:
  • Size: 66.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for audiospylt-0.6.0a0.tar.gz
Algorithm Hash digest
SHA256 bce6ac65f1dd5bacabb83acf461d8526c3d3f47a441639314f125f61d9e9fbb9
MD5 93383583ef707e015d52eedeae678fb0
BLAKE2b-256 d3e26796b4ee8923a6c5365afbab1b5ec8f7ddb6eebd9e72f986125d3cb017c4

See more details on using hashes here.

File details

Details for the file audiospylt-0.6.0a0-py3-none-any.whl.

File metadata

  • Download URL: audiospylt-0.6.0a0-py3-none-any.whl
  • Upload date:
  • Size: 67.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for audiospylt-0.6.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 42eba17d97e9d626b299d7b19ddf3485d9ed74bd8f300f88283c16d29b4822e8
MD5 91a7b0ce0213cc0c4a52970034f8eebd
BLAKE2b-256 811a8f102314f527dfac4442490cd5d32bf8dd321cac06041c2cc82b1be3574b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page