Re: Wrapper for combination of nodes

> I'm struggling to find a decent solution to packaging a group of nodes
> together in a way that can be used similarly to native nodes. For example,
> the recent Jam with Chrome article on html5rocks does this :
>
> var MyCustomNode = function(){
>     this.input = audioContext.createGainNode();
>     var output = audioContext.createGainNode();
>
>     this.connect = function(target){
>        output.connect(target);
>     };
> };

Hi Stuart!

Could you return output from your MyCustomNode function?

  var MyCustomNode = function(){
      this.input = audioContext.createGainNode();
      var output = audioContext.createGainNode();

      this.connect = function(target){
         output.connect(target);
      };

      return output;
  };

I think this would let you do:

 gain.connect(customNode);

If I understand correctly what you mean.

Cheers,

Chris

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

Received on Tuesday, 18 December 2012 11:10:33 UTC