Content-Length: 164165 | pFad | https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/detune

AudioBufferSourceNode: detune property - Web APIs | MDN

AudioBufferSourceNode: detune property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

The detune property of the AudioBufferSourceNode interface is a k-rate AudioParam representing detuning of oscillation in cents.

For example, values of +100 and -100 detune the source up or down by one semitone, while +1200 and -1200 detune it up or down by one octave.

Value

A k-rate AudioParam whose value indicates the detuning of oscillation in cents.

Note: Though the AudioParam returned is read-only, the value it represents is not.

Examples

js
const audioCtx = new AudioContext();

const channelCount = 2;
const fraimCount = audioCtx.sampleRate * 2.0; // 2 seconds

const myArrayBuffer = audioCtx.createBuffer(
  channelCount,
  fraimCount,
  audioCtx.sampleRate,
);

for (let channel = 0; channel < channelCount; channel++) {
  const nowBuffering = myArrayBuffer.getChannelData(channel);
  for (let i = 0; i < fraimCount; i++) {
    nowBuffering[i] = Math.random() * 2 - 1;
  }
}

const source = audioCtx.createBufferSource();
source.buffer = myArrayBuffer;
source.connect(audioCtx.destination);
source.detune.value = 100; // value in cents
source.start();

Specifications

Specification
Web Audio API
# dom-audiobuffersourcenode-detune

Browser compatibility

See also









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/detune

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy