2.2.0 • Published 11 years ago
openmusic-theremin v2.2.0
openmusic-theremin
A theremin audio node
Installing and building
With NPM
From repository:
git clone https://github.com/openmusic/theremin.gitThen install build dependencies, etc with:
npm installTo build a bundle for the demo:
npm run buildDemo files will be placed in build/. Open build/index.html to access the demo.
Remember to rebuild the bundle each time you make a change to the demo or node code. Alternatively you can also run the watch task, so it will watch for file changes and then rebuild the bundle for you:
npm run watchUsage
Create an instance of the node by passing it an audio context:
var Theremin = require('openmusic-theremin');
var audioContext = new AudioContext();
var thereminNode = Theremin(audioContext);This node can be connected together like any other Web Audio node:
var gainNode = audioContext.createGain();
thereminNode.connect(gainNode);Attributes
frequency (AudioParam)
theremin.frequency.value = 123;
theremin.frequency.setValueAtTime(440, 0);