npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vstjs

v0.0.4

Published

<p align="center"> <img width="200" src="https://raw.githubusercontent.com/ramirezd42/vst-js/master/logo.png"> </p>

Downloads

21

Readme

What Is It?

vst.js is a native NodeJS addon that can be used to launch VST3 plugins (including GUI interface) in a separate process.

WARNING:

This library is in an extremely experimental state. Large portions of functionally have yet to be implemented and it is currently only buildable for OSX devices, although since everything is built with crossplatform libraries, building for other operating systems shouldn't be too difficult.

Additionally, I'm learning C++ by developing this project. If you have any criticisms on my approach or code quality I'd love to hear them.


Installation

Install CMake

vst.js uses CMake as its build system and requires it be present on your system before installing. On a Mac the easiest way to install CMake is via homebrew:

> brew install cmake

Install Boost 3.6+

vst.js makes use of the popular Boost C++ Framework. It expects that version 3.6 or higher is available on your system prior to installation. The easiset way to install the Boost framework on a Mac is via homebrew:

> brew install boost

Acquire the Steinberg VST3 SDK (3.6.7+)

Due to licensing concerns I am currently not bundling the VST3 SDK along with this project. You will need to download the SDK from Steinbergs's Website and place it at ~/SDKs/VST3

You can also specify the installed location of the VST3 SDK by setting a the VST3_SDK_PATH environment variable prior to installation

NPM Install

Once all the above dependencies have been satisfied you can install via npm:

> npm install vstjs

Usage Examples

The example below will play back an audio file via node-web-audio-api, and manipulate the audio via a VST3 plugin

const { AudioContext } = require('web-audio-api')
const Speaker = require('speaker')
const fs = require('fs')
const path = require('path')
const vstjs = require('vstjs')

const bufferSize = 512
const numChannels = 2
const pluginPath = process.argv[2]
const filePath = process.argv[3]

const pluginHost = vstjs.launchPlugin(pluginPath)
pluginHost.start()

// setup webaudio stuff
const audioContext = new AudioContext()
const sourceNode = audioContext.createBufferSource()
const scriptNode = audioContext.createScriptProcessor(bufferSize, numChannels, numChannels)


audioContext.outStream = new Speaker({
  channels: audioContext.format.numberOfChannels,
  bitDepth: audioContext.format.bitDepth,
  sampleRate: audioContext.sampleRate,
})

sourceNode.connect(scriptNode)
scriptNode.connect(audioContext.destination)


scriptNode.onaudioprocess = function onaudioprocess(audioProcessingEvent) {
  const inputBuffer = audioProcessingEvent.inputBuffer
  const channels = [...Array(numChannels).keys()]
    .map(i => audioProcessingEvent.inputBuffer.getChannelData(i))

  // process audio block via pluginHost
  pluginHost.processAudioBlock(numChannels, bufferSize, channels)
  audioProcessingEvent.outputBuffer = inputBuffer
}

fs.readFile(filePath, (err, fileBuf) => {
  console.log('reading file..')
  if (err) throw err
  audioContext.decodeAudioData(fileBuf, (audioBuffer) => {
    sourceNode.buffer = audioBuffer
    sourceNode.start(0)
  }, (e) => { throw e })
})