RepositoryJavaScriptESSpain
jerosoler

jerosoler/waveform-path

🎙 Generator waveform paths for SVG 🎶

135stars
8forks
4issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: audio-visual

#1 Repository of the month

1
TINIX TRENDING·Topic: audio-visualizer

#1 Repository of the month

1
TINIX TRENDING·Topic: webaudio

#1 Repository of the month

npm npm bundle size GitHub license Twitter URL

waveform-path

Logo

LIVE DEMO WITH EXAMPLES

Simple library to custom waveforms.

Install

NPM

npm install waveform-path -s

Download

Download the last realease of repo and copy waveform-path.es.js from dist folder.

How to use

Linear Options

OptionDefaultDescription
channel0Channel audio for generate wave
sampleslengthLength of the data
height100Height of path
width800Width of path
top0Top margin from path to svg
left0Left margin from path to svg
type'steps''steps', 'mirror' or 'bars'
paths[{d:'Q', sx: 0, sy:0, x: 50, y: 100, ex:100, ey:0}]Array of commands to create the path.
animationfalseTo create animations, paths separated by commas
animationframes10Frames per second of the animation
normalizetrueNormalize audio to adjust waveform

Linear Path Options

// Lineto
{d:'L', sx: 0, sy:0, ex:50, ey:100 }

// Horitzontal
{d:'H', sx:10, y:90, ex:90}

// Vertical
{d:'V', sy:0, x:0, ey:100}

// Cubic Bézier Curve - Not 100%
{d:'C', sx: 0, sy:0, x: 100, y: 100, ex:100, ey:0 },

// Quadratic Bézier Curve
{d:'Q', sx: 0, sy:0, x: 50, y: 100, ex:100, ey:0}

// Arc
{d:'A', sx: 0, sy:100,  ex:100, ey:100, rx:10, ry: 10, angle: 180, arc: 1, sweep: 1}

// Z - Close Path no parameters
{d:'Z'}

sx = start % x position
x = center % x position
ex = end % x position

sy = start % y position
y = center % y position
ey = end % y position

These three extra options can be added:
minshow: 0.2  // Values 0 to 1 - Default 0
maxshow: 1 // Values 0 to 1 - Default 1
normalize: true // Normalize value y to 1. - Default false
Example: 
{d:'H', sx:10, y:90, ex:90, minshow: 0.4, maxshow: 0.6, normalize: true} // Only for y > 0.4 && y < 0.6

For arc view: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve

Polar Options

OptionDefaultDescription
channel0Channel audio for generate wave
sampleslengthLength of the data
distance50Distance from center
length100Length of wave
top0Top margin from path to svg
left0Left margin from path to svg
type'steps''steps', 'mirror' or 'bars'
startdeg0Where do you start drawing. To make it natural, 0 is equivalent to north.
enddeg360Where do you end drawing
invertdegfalseReverse the direction of the degrees
invertpathfalseReverse the path vertically
paths[{d:'Q', sdeg: 0, sr:0, deg: 50, r: 100, edeg:100, er:0}]Array of commands to create the path.
animationfalseTo create animations, paths separated by commas
animationframes10Frames per second of the animation
normalizetrueNormalize audio to adjust waveform

Polar Path Options

// Lineto
{d:'L', sdeg:0, sr:0,  edeg:100, er:100 },

// Cubic Bézier Curve - Not 100%
{d:'C', sdeg: 0, sr:0, deg: 50, r: 100, edeg:100, er:0}

// Quadratic Bézier Curve
{d:'Q', sdeg: 0, sr:0, deg: 50, r: 100, edeg:100, er:0}

// Arc
{d:'A', sdeg:80, sr:0, edeg: 0, er:0, rx: 100, ry: 100, angle: 100, arc: 0, sweep: 1 },

// Z - Close Path no parameters
{d:'Z'}

sdeg = start % deg position
deg = center % deg position
edeg = end % deg position

sr = start % radius position
r = center % radius position
er = end % radius position

These three extra options can be added:
minshow: 0.2  // Values 0 to 1 - Default 0
maxshow: 1 // Values 0 to 1 - Default 1
normalize: true // Normalize value radius to 1. - Default false
Example: 
{d:'Q', sdeg: 0, sr:0, deg: 50, r: 100, edeg:100, er:0, minshow: 0.4, maxshow: 0.6, normalize: true} // Only for y > 0.4 && y < 0.6

For arc view: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
naomiaro/waveform-playlist

Multitrack Web Audio editor and player with canvas waveform preview. Set cues, fades and shift multiple tracks in time. Record audio tracks or provide audio annotations. Export your mix to AudioBuffer or WAV! Add effects from Tone.js. Project inspired by Audacity.

1.7k
Nov 28, 2026
RepositoryTypeScript
katspaugh/wavesurfer.js

Audio waveform player

10.5k
Nov 24, 2026
RepositoryC++
snapcast/snapcast

Synchronous multiroom audio player

8.1k
Nov 25, 2026
RepositoryPHP
koel/koel

Music streaming solution that works.

17.4k
Dec 1, 2026
RepositoryC++
sonic-pi-net/sonic-pi

Code. Music. Live.

12.3k
Nov 27, 2026
RepositorySwift
AudioKit/AudioKit

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

11.5k
Jul 26, 2026
RepositoryRust
crmne/spotifast

Spotify, native and fast. One lightweight Rust app for your whole library, local playback, and Spotify Connect on Linux, macOS, and Windows.

11.0k
Dec 1, 2026
RepositoryPython
AIGC-Audio/AudioGPT

AudioGPT: Understanding and Generating Speech, Music, Sound, and Talking Head

10.2k
Jul 6, 2024
RepositoryPython
librosa/librosa

Python library for audio and music analysis

9.3k
Dec 2, 2026