Skip to content

Instantly share code, notes, and snippets.

@deveedutta
deveedutta / chord.js
Created Oct 6, 2016
Chord React component that plays a combination of 3 oscillators to generate a Chord
View chord.js
// A Chord react (or call it preact) component that plays a combination of 3 oscillators
// And generates various chords
// <Chord chordname="C Major" frequencies="196.00, 261.63, 329.63" type="sine" />
import { h, Component } from 'preact';
import style from './style';
const audioContext = new (window.AudioContext || window.webkitAudioContext);
export default class Chord extends Component {