Bug 18442 - noteOn() and noteOff() methods should be renamed
Summary: noteOn() and noteOff() methods should be renamed
Status: CLOSED DUPLICATE of bug 17344
Alias: None
Product: AudioWG - OBSOLETE - Moved to Github
Classification: Unclassified
Component: Web Audio API - OBSOLETE - See Github (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: public-audio
Depends on:
Reported: 2012-07-31 00:21 UTC by Joe Berkovitz / NF
Modified: 2012-09-10 10:13 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joe Berkovitz / NF 2012-07-31 00:21:32 UTC
The noteOn() and noteOff() methods of AudioBufferSourceNode are confusingly named in two respects.  

1. The noteOff() method's name suggests a strong similarity to the MIDI concept of "Note Off", but the two ideas differ in a way that is likely to be confusing. The MIDI terminology is already well established and familiar to musicians. A MIDI "Note Off" event typically triggers the start of the release phase of a virtual instrument's note, which can last for an arbitrary amount of time before audio output actually ceases (since most musical instruments do not immediately stop producing sound when the performer stops playing).  On the other hand, the noteOff() method causes audio to completely cease at the specified time.

2. The node may serve as a source for many kinds of audio other than musical notes, so the terminology is needlessly narrow.

Chris Rogers has suggested that start() and stop() may be clearer alternatives.
Comment 1 Adam Goode 2012-07-31 00:39:47 UTC
start() and stop() are fine, but since stop() is destructive, maybe destroyAt(time) is more representative?
Comment 2 Joe Berkovitz / NF 2012-07-31 00:59:28 UTC
I'd say that although stop() is destructive that is a side effect of its perceived purpose, which is to cause the audio source to stop making sound at the specified time.
Comment 3 Philip Jägenstedt 2012-07-31 09:21:41 UTC
This is a duplicate of Bug 17344, but I don't seem to the the powers to resolve it as such.
Comment 4 Joe Berkovitz / NF 2012-07-31 10:46:28 UTC
Somehow I missed the bug of which this is a duplicate -- sorry!

*** This bug has been marked as a duplicate of bug 17344 ***
Comment 5 Olivier Thereaux 2012-09-10 10:13:14 UTC
Closing duplicate. 

bug 17344 shall remain open until agreed changes make it to the spec.