[Web MIDI API] send() method should also allow 3 shorts + timestamp

Currently, the send() method is defined as:   
void send (sequence<short> data, optional DOMHighResTimeStamp? timestamp);

However, it appears to me that it is extremely common to only want to send 3 bytes of data at a time (+ optional timestamp)… Having now been playing around with the API for about 10 hours, I actually keep forgetting to put things into an array (which leads to annoying errors). Can I recommend that the send interface be overloaded:

void send (sequence<short> data, optional DOMHighResTimeStamp? timestamp);
void send (short byte1, short byte2, short byte3, optional DOMHighResTimeStamp? timestamp);  

That would make the interface much more natural to work with and avoid having to remember to put things into an array all the time.  

--  
Marcos Caceres
http://datadriven.com.au

Received on Sunday, 16 December 2012 07:30:33 UTC