Re: [whatwg] VIDEO and pitchAdjustment

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.

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
>

Received on Thursday, 3 March 2016 09:19:00 UTC