rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.89k stars 160 forks source link

setPitch function is broken in both poly wads and Oscillators #89

Closed frastlin closed 6 years ago

frastlin commented 6 years ago

There may be a couple problems here, but the set functions should be tested again. Poly Wads: It is possible to set the pitch of a polyWad in the play function, but there is no setPitch on the poly object, either before or during playback. I don't know if there are the other functions either. I tried setVolume and there was no error, although I didn't hear much difference in sound and setPanning also through an error.

TypeError: poly1.setPitch is not a function

Oscillators: The setPitch function is broken while the sound is stopped, but works when the sound is playing.

const sound1 = new Wad({
    source: 'sine'
})
sound1.setPitch(200)

Gives the following error:

TypeError: this.soundSource is undefined
["./node_modules/web-audio-daw/build/wad.js"]/</<["./src/wad.js"]/</Wad</Wad.prototype.setPitch
C:/project/node_modules/web-audio-daw/build/wad.js:3163
3160 |       this.soundSource.frequency.value = Wad.pitches[pitch];
3161 |     }
3162 |     else {
> 3163 |       this.soundSource.frequency.value = pitch;
3164 |     }
3165 |     return this;
3166 | };
rserota commented 6 years ago

I just fixed setPitch in Wads, and added it to PolyWads, which never had it to begin with.

Thanks for raising all these issues, by the way.

frastlin commented 6 years ago

thank you for being so responsive! This is what allows me to keep using Wad. I tell everyone who I talk with about Wad, it really makes working with the Web Audio API so much easier. does 4.2 have this functionality?

rserota commented 6 years ago

Yeah, everything should be working properly in 4.2.0.

Thanks for telling people about Wad. I really appreciate it.