Skip to content

Latest commit

 

History

History
58 lines (32 loc) · 2.13 KB

README.md

File metadata and controls

58 lines (32 loc) · 2.13 KB

Generic DSP Interface

npm install dsp-interface

Require this generic, real-time, socketed HTML5 / Touch compatible web socket interface. It returns two arrays, which valaues you can change in your browser.

pretty generic!

POSTED: This is a string transporting, float parsing, pseudo midi signal! The GUI is a clumsy, DOM based implementation with non-continunous values! And I traded multi-touch non working range sliders for single touch capable sliders that actually work... so it works on the ipad.

Future version will be nice tho: binary transport, real midi, canvas face, continuous value ranges.

The interface has 10 range sliders, and 8 corresponding exponents buttons.

var gui = require('dsp-interface');

gui.start(5001); // optional port, defaults to 8012

gui.line // a length 10 array
gui.exp // a length 10 array ([0] and [1] are always zero);

function(time){
  return Math.sin( time * Math.PI * ( gui.line[3] * Math.pow(10, gui.exp[3]) ))
}

You can set your initial values

var mui = require('dsp-interface');

var values = [1,1,-10,1,1,1,1,1,1,1]; // there are 10 range sliders

var exponents = [0,0,1,1,2,2,3,3,3,3]; // only 8 lines have exponent switches. The first two indecies will always be zero!!!!!!

mui.start(5001, values, exponents)

the interface will start at those values

API

interface.line

  • line[0] and line[1] have range [0,11] inclusive to correspond with either cranking it past ten, or for 12 octaves for each of the 12 note classes in the western scale. Why 12 octaves? You can't hear 7 hertz, but you can feel it!

  • line[2]'s range is [-12, 12] inclusive (for semitones). It is the only line with negative values.

  • lines 3-9 have range [0, .9.9] at intervals of 0.1.

interface.exp

  • ui.exp channels 2-9 return values 0-3, meant to be used to define the exponent for the their corresponding channels values. exp[0] and exp[1] are always zero.

  • exp[0] and exp[1] are not used, and always zero

TODO:

  • Add incr / decr buttons to range sliders
  • Add on/off punch buttons
  • Add placeholders for values you want to come back to