Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 750 Bytes

sidechain.md

File metadata and controls

36 lines (25 loc) · 750 Bytes

Hello sound

This is a minimal demo of using Glicol. Vite is recommand as the build tool for your web app.

Installation

npm i glicol

Import the package

import Glicol from 'glicol'
import { sin } from 'glicol'
const glicol = new Glicol()

Bind the play to a GUI action

Due to many browsers' limitation, audio playing requires a GUI action such as a button click.

For vanilla JS, you can do like this:

document.getElementById("play").onclick = () => {
    glicol.play({
        o: sin(440)
    })
}

Full project example

https://stackblitz.com/edit/glicol-js-helloworld