Skip to content

eldarsadykov/VectorANS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VectorANS

VectorANS is a vector graphics to audio synthesis tool that converts SVG drawings into audio waveforms. It interprets SVG paths as frequency modulation data over time, creating unique sonic textures from visual art.

Features

  • SVG to Audio Conversion: Parses SVG files and converts vector paths into audio signals
  • Additive Synthesis: Uses multiple oscillators (voices) to create rich, layered sounds
  • Configurable Parameters: Control duration, sample rate, frequency range, and more
  • Cubic Bézier Curve Support: Handles complex SVG curves with proper monotonic splitting

How It Works

VectorANS interprets SVG drawings along two axes:

  • X-axis (horizontal): Represents time progression
  • Y-axis (vertical): Represents frequency (pitch), mapped to a configurable frequency range

Each path in the SVG becomes a "voice" in the synthesizer, and the combined output of all voices creates the final audio.

Building

Prerequisites

  • CMake 4.1 or higher
  • C++17 compatible compiler

Build Instructions

mkdir build
cd build
cmake ..
cmake --build .

Usage

./VectorANS <input_file> [output_file] [duration] [sample_rate] [f_min] [f_max] [logs]

Arguments

  • input_file (required): Path to the input SVG file
  • output_file (optional): Output WAV file path (default: output.wav)
  • duration (optional): Audio duration in seconds (default: 8.0)
  • sample_rate (optional): Sample rate in Hz (default: 44100.0)
  • f_min (optional): Minimum frequency in Hz (default: 32.0)
  • f_max (optional): Maximum frequency in Hz (default: 8192.0)
  • logs (optional): Enable verbose logging (true/false, default: false)

Example

./VectorANS drawing.svg output.wav 10.0 44100 40 10000 true

This converts drawing.svg to a 10-second audio file with frequencies ranging from 40 Hz to 10 kHz.

Dependencies

  • nanosvg: Lightweight SVG parsing library (header-only, included)

License

MIT License.

Author

Eldar Sadykov

About

SVG-to-WAV converter inspired by ANS synthesizer

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors