How do I add tempo and pitch with JS?

I am quite a beginner to JS, and I’m new to using libraries, so sorry if this is terrible on my part. Also new to freeCodeCamp forum, so if this is not the place to ask questions, I am truly sorry.

Anyway, I’ve created this website on github
www.stevenphotos.github. io/reverb/
with ToneJS. You can basically choose any song and then with the input ranges change the reverb, pitch and how slow (playbackRate) it is. (You can view page source and look in the script) One problem is that the pitchShift from toneJS distorts the audio quite badly.

I came across someone who created this
www.dumbmatter. com/screw/
It’s in one of the comments on this reddit post.
www.reddit. com/r/javascript/comments/af9nip/how_to_pitch_shift_in_js/
He also said that the majority of the work came from this:
www.github. com/dumbmatter/screw/blob/master/src/vendor/soundtouch.js

This seems to not distort audio too much and it’s cool that they’ve made it so you can scroll through the timeline and change the tempo and pitch. I guess all I’d need is the reverb from my project but I really have 0 clue on how I would combine the library he posted (or if I should even do that or if it’s possible) with ToneJS.

Don’t need an exact solution (although that would be great), any tutorials online that you’ve come across that would help with this are muchly appreciated as well.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.