Re: [whatwg] VIDEO and pitchAdjustment

On Thu, Mar 3, 2016 at 1:18 AM, Paul Adenot <padenot@mozilla.com> wrote:
> That looks appropriate, and is in line with how the Web Audio API does
> detuning (using the same unit, [0]).
>
> That said, I'm not sure about the use case here? Time-stretching (normal
> playbackRate) is useful, for example, to watch a conference slightly faster
> in order to save some time. I can't really find non-musical use-cases, and
> musical use-cases are maybe better served using the Web Audio API.
>

In summary:

User wants to hear the audio at the desired pitch, for accompaniment
or learning purposes, ideally while simultaneously watching the video
at the desired speed, using a video sharing or lesson websites.

User finds a version of the artist performing the piece among other
versions and lessons in various tunings. The user uses adjusts video's
pitch, independently of playback speed, to match his instrument's
tuning using.

The pitch control can be provided by a user script, bookmarklet, or extension.*

Existing software for this includes Amazing Slow Downer.

(more below)

Thank you,


> Paul.
>
> [0]:
> http://webaudio.github.io/web-audio-api/#widl-AudioBufferSourceNode-detune
>
> On Thu, Mar 3, 2016 at 12:00 AM, Garrett Smith <dhtmlkitchen@gmail.com>
> wrote:
>>
>> On Wed, Mar 2, 2016 at 1:09 PM, Garrett Smith <dhtmlkitchen@gmail.com>
>> wrote:
>> > On Wed, Mar 2, 2016 at 2:36 AM, Philip Jägenstedt <philipj@opera.com>
>> > wrote:
>> >> On Wed, Mar 2, 2016 at 5:08 PM, Paul Adenot <padenot@mozilla.com>
>> >> wrote:
>> >>>
>> >>> Gecko uses code that can do arbitrary pitch adjustment, unrelated to
>> >>> time-stretching (which is speed change with pitch compensation).
>> >>
>> >> That's neat. If you're interested in exposing this as an API on
>> >> HTMLMediaElement, can you file a spec bug with a proposal of how it
>> >> might work?
>> >>
>> >
>> > Here is what I had in mind; hope it helps.
>> >
>> > Create a new property `pitchAdjustment` on HTMLMediaElement to adjust
>> > pitch in cents.
>> >
>> > Equally tempered semitones span 100 cents.
>> >
>> > The developer can use INPUT type="range" with an oninput, to allow the
>> > user to adjust the video's pitch, in cents.
>> >
>> > interface HTMLMediaElement : HTMLElement {
>> >  attribute unsigned short pitchAdjustment;
>> >  …
>> > }
>> >
>>
>> Not unsigned, sorry.
>>
>> interface HTMLMediaElement : HTMLElement {
>>   attribute short pitchAdjustment;
>>   …
>>  }
>>
>> That should allow for pitch adjustment over 54 octaves. This is
>> withing human hearing range of 10 octaves. 1 having the value of one
>> cent, gives 1200 cents per octave.
>>
>> let
>>  semitone = 100, // cents
>>  octave = 12 * semitone, // 1200
>>  sizeOfShort = 65535;
>> sizeOfShort / octave 54.6125
>>
>> Signed short range is −32768 to 32767
>> --
>> Garrett
>> @xkit
>> ChordCycles.wordpress.com
>> garretts.github.io
>> personx.tumblr.com
>
>



-- 
Garrett
@xkit
ChordCycles.wordpress.com
garretts.github.io
personx.tumblr.com

Received on Thursday, 3 March 2016 22:04:25 UTC