webaudio-examples icon indicating copy to clipboard operation
webaudio-examples copied to clipboard

[step-sequencer] The slider input to set the DTMF rate is not working as expected

Open ManuLintz opened this issue 1 year ago • 3 comments
trafficstars

What information was incorrect, unhelpful, or incomplete?

This input doesn't behave as it should: image

What did you expect to see?

When setting the slider like this, we don't hear anything anymore (here): image

The problem comes from that the value is cast into an int in the event listener callback (also happens in https://github.com/mdn/webaudio-examples/issues/117).

rateControl.addEventListener(
  "input",
  (ev) => {
    playbackRate = parseInt(ev.target.value, 10);
  },
  false
);

It was written to have a 0.1 step:

<section class="controls">
  <label for="rate">Rate</label>
  <input
    name="rate"
    id="rate"
    type="range"
    min="0.1"
    max="2"
    value="1"
    step="0.1"
  />
</section>

Since I identified what causes the issue in the code I'd be happy to work on a fix + updating the doc.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

ManuLintz avatar Dec 12 '23 11:12 ManuLintz

Thanks a lot for reporting it! There's a PR open which should fix this

Since I identified what causes the issue in the code I'd be happy to work on a fix + updating the doc.

Sorry I missed this, would you like to update the doc after this is merged?

bsmth avatar Jan 25 '24 10:01 bsmth

Yes sure, I'd love to

ManuLintz avatar Jan 25 '24 10:01 ManuLintz

Great, feel free to ping me on the PR when you get around to it.

bsmth avatar Jan 25 '24 10:01 bsmth