W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: Arithmetic Nodes

From: Marcus Geelnard <mage@opera.com>
Date: Mon, 01 Jul 2013 16:50:10 +0200
Message-ID: <51D19722.4050809@opera.com>
To: chris.lowis@bbc.co.uk
CC: WebAudio <public-audio@w3.org>
Hi Chris,

2013-07-01 15:45, Chris Lowis skrev:
> Would it be useful to add some very basic arithmetic nodes to the Web
> Audio API?
>
> I'm thinking:
>   - addition
>   - multiplication
>   - subtraction
>   - division
>   - comparison (1 (HIGH) when A > B, -1 (LOW) otherwise)

I really think that ScriptProcessorNodes are sufficient for these kind 
of operations. If they are considered too heavy, I think that arithmetic 
nodes could built on top of them (it should be easy enough to do it as a 
JS lib).

You could also consider doing an even more generic node type that 
accepts an ECMAScript expression, such as "0.5 + 0.5*Math.sin(x)" 
(Simulink has something similar for instance: 
http://www.mathworks.se/help/simulink/slref/interpretedmatlabfunction.html 
), but then we are getting seriously close to the ScriptProcessorNode.

/Marcus

>
> These nodes could be restricted to taking two inputs for simplicity, and
> performing their arithmetic in a channel-wise fashion. I appreciate that
> we have 'addition' implicity by summing-on-input on other nodes. I guess
> a ScriptProcessorNode can perform all of these operations, but they seem
> fundamental enough to include in the core set of nodes.
>
> I think this request has been raised before. I'd be happy to write a
> proposed specification if that would help?
>
> 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.
> -----------------------------


-- 
Marcus Geelnard
Technical Lead, Mobile Infrastructure
Opera Software
Received on Monday, 1 July 2013 14:57:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:10 UTC