oampo/Audiolet — pull request #43 by catshirt (2013-03-09 18:30:51+00:00)
Title: V2/parameter map

hello,

here is some implementation of a parameter map.

here is an example map: https://github.com/catshirt/Audiolet/blob/v2/parameter-map/src/dsp/Reverb.js#L32-L36

here is the core mapping logic: https://github.com/catshirt/Audiolet/blob/v2/parameter-map/src/core/AudioletNode.js#L38-L47

for instance, in the case of `parameters: { frequency: [0, 440] }`, an AudioletParameter will be assigned to `node.frequency`, bound to input 0 with a default value of 440. it's important to note that the nodes `parameters` are stagnant: so parameters[1] will always access the default value, not the current value. maybe a better name than parameters is defaults?

there is one breaking change which i can't find any use of: `generate` was removed as an argument to the nodes constructor. so you must set it on the prototype now. the reason for this is i wanted to still give nodes the ability to [override parameter defaults in the constructor](https://github.com/catshirt/Audiolet/blob/v2/parameter-map/src/dsp/Reverb.js#L67-L71). having generate in the arguments meant you'd always be passing `null` as an option before the parameters, and it seemed simpler to just remove it.