Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glicol

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glicol

An light-weight, garbage-collection-free, and easy-to-use audio engine for browser-based music apps.

  • 0.2.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by140%
Maintainers
1
Weekly downloads
 
Created
Source

What's this?

This is a light-weight, garbage-collection free, memory-safe and easy-to-use audio library for browsers. It's written in Rust and ported to JS via WebAssembly and runs in AudioWorklet. The communication is realised with SharedArrayBuffer.

Note that you need to have cross-origin isolation enabled on the web server (both the dev server and the one you deploy your web app) to use this package. For vite dev server, you can use my plugin here. For deployment on Netlify or Firebase, check their docs for editing the header files. If you use a customised server, you have to figure it out yourself.

Usage

This is a proof of concept and the API may change. But after you npm i glicol, you can just write:

import Glicol from "glicol"
const glicol = new Glicol()

Then you run your main audio graph logic:

glicol.run(`o: saw 50 >> lpf 300.0 1.0`)

You can call the run again if you want to change some parameters. There won't be an update to the whole graph. Instead, the Glicol Rust engine will be smart enough to tell the difference and only update where is modified.

glicol.run(`o: saw 50 >> lpf 300.0 1.0`)

Another style is to send message to the engine:

// track "o", node_index 0, param 0, set to 110
glicol.send_msg(`o, 0, 0, 110`);

You can use it with GUI, see this example:

https://glicol-npm.netlify.app

Multiple message in one String is also possible.

glicol.send_msg(`o, 0, 0, 110; o, 1, 0, 500; o, 1, 1, 0.8`);

Feedback

There are many todos for this package. Please let me know your thoughts and suggestions here:

https://github.com/chaosprint/glicol

Issues or Discussion are both fine.

Dev note (not for users)

pnpm link --dir /usr/local/lib/ glicol

Keywords

FAQs

Package last updated on 16 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc