All Projects → joshwcomeau → Waveforms

joshwcomeau / Waveforms

Licence: mit
An interactive, explorable explanation about the peculiar magic of sound waves.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Waveforms

Taro
A lightweight 3D game engine for the web.
Stars: ✭ 345 (-71.67%)
Mutual labels:  svg, canvas
People You Should Follow On Codepen
People You Should Follow on CodePen
Stars: ✭ 542 (-55.5%)
Mutual labels:  svg, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+279.97%)
Mutual labels:  svg, canvas
D3tutorial
📊📈 A D3 v6 tutorial - interactive bar chart and multiple coordinated views (MCV)
Stars: ✭ 163 (-86.62%)
Mutual labels:  tutorial, svg
D3
This is the repository for my course, Learning Data Visualization with D3.js on LinkedIn Learning and Lynda.com.
Stars: ✭ 64 (-94.75%)
Mutual labels:  tutorial, svg
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (+143.27%)
Mutual labels:  svg, canvas
Zrender
A lightweight graphic library providing 2d draw for Apache ECharts
Stars: ✭ 5,122 (+320.53%)
Mutual labels:  svg, canvas
Three.js
JavaScript 3D Library.
Stars: ✭ 78,237 (+6323.4%)
Mutual labels:  svg, canvas
Calendar Graph
Calendar graph like github using jsx support SVG, Canvas and SSR
Stars: ✭ 58 (-95.24%)
Mutual labels:  svg, canvas
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-95.48%)
Mutual labels:  svg, canvas
Re Learn
A library for integrating tutorials into your re-frame/reagent application
Stars: ✭ 131 (-89.24%)
Mutual labels:  tutorial, lesson
Pasition
Path Transition with little JS code, render to anywhere - 轻量级 Path 过渡库,渲染到任何地方
Stars: ✭ 1,149 (-5.67%)
Mutual labels:  svg, canvas
Godot tutorials
Code and examples for KidsCanCode Godot Tutorials.
Stars: ✭ 119 (-90.23%)
Mutual labels:  tutorial, lesson
Flutter Canvas
About using of canvas in the flutter
Stars: ✭ 259 (-78.74%)
Mutual labels:  tutorial, canvas
Binari
Interactive code editor with a live binary tree visual designed to teach new developers the fundamentals of dynamic programming.
Stars: ✭ 82 (-93.27%)
Mutual labels:  tutorial, canvas
React From Zero
A simple (99% ES2015 less) tutorial for React
Stars: ✭ 4,638 (+280.79%)
Mutual labels:  tutorial, lesson
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (-83.17%)
Mutual labels:  svg, canvas
Rough
Create graphics with a hand-drawn, sketchy, appearance
Stars: ✭ 16,472 (+1252.38%)
Mutual labels:  svg, canvas
Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (-51.15%)
Mutual labels:  svg, canvas
Zdog
Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
Stars: ✭ 8,904 (+631.03%)
Mutual labels:  svg, canvas

Waveforms

Convergence Demo

This interactive guide introduces and explores waveforms. It covers how to read waveform graphs, goes over the fundamental physics of sound, teaches how it relates to music and harmony, and demonstrates how to build complex tones from simple ones.

This guide is aimed at a general audience–no prior knowledge is required.

Check it out!


Future plans

I'm toying with the idea of making this a series. There are other interesting audio concepts to explore. Off the top of my head:

  • FFT
  • Human perception of sound
  • Phase offset effects like phasers, flangers, delays, and reverb
  • Distortion (clip distortion, bit reduction)
  • FM/AM synthesis
  • Envelope generators and filters.

It's likely I won't get to this anytime soon, but do let me know if you think there's a need for interactive explanations of these concepts!

How It's Made

This tutorial-thingy is purely front-end, built with React. No state management library was needed. Styled with styled-components.

The waveforms are rendered with SVG (although they can also render to Canvas with the change of a prop), and the air molecule grids render to Canvas. I used the fancy new IntersectionObserver to handle the scroll-based logic, with a fallback to a simple scroll listener.

NOTE: This was a very interesting project from a technical perspective! I needed to draw Waveforms in lots of different configurations and states. Waveforms can be one of a series of predefined shapes, or arbitrary shapes (as is the case when converging multiple waveforms together). Waveforms can be "playing", and any state change that can happen (even changing the waveform shape) needs to work whether it's staying still or playing. Also, every transition should use spring physics. Also, it should be performant while doing all of this.

I started writing up how it works, but I realized that it is super non-trivial, and it deserves a proper blog post. I would like to write that blog post at some point. If this interests you, feel free to poke me on Twitter and remind me.

You can also poke around yourself! Check out all the components that start with Waveform, like WaveformPlayer or WaveformTween.

Running locally

Want to run this on your machine? it should be as simple as git clone, yarn install, and yarn:start. Let me know if that fails.

Contributing

Please open issues describing changes you'd like to contribute before spending any time working on them; this is a personal side-project, and I open-sourced it primarily as an educational thing, for those curious how it was built. I'm not actively seeking external contributions, and there would be a bit of friction (this repo is no longer the "source of truth" for the project, as it lives on The Pudding).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].