rserota / wad

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

Add multiple filters #10

Closed coleww closed 10 years ago

coleww commented 10 years ago

resolves #3

rserota commented 10 years ago

Hey, sorry I haven't gotten to this yet. I've been sorta busy recently at a new job, but I intend to test out this code very soon, and merge it this weekend. Thanks for the contribution!

coleww commented 10 years ago

No worries, I actually just started a new job too. I've been working on a test script for wad as well which will hopefully smooth out things in the future.

rserota commented 10 years ago

The code all looks like it works well, so I merged your pull request. Thanks for the contribution! However, I have one question: On line 361, if a Wad is played with filters set as constructor arguments, but not as play() arguments, you call createFilters(that, that). Is it necessary to pass in 'that' for the second argument? createFilters already falls back to the filters on 'that' if 'arg' is undefined, so isn't it sufficient (and in my opinion, more clear) to simply call createFilters(that) ?

A test script would be fantastic. I realize that Wad.js is sorely missing any kind of automated testing.

coleww commented 10 years ago

IIRC that was so that something would be passed. If arg wasn't passed, it would check undefined.filter[i].env which would throw an error i think. There is probably a much cleaner way to do it.

coleww commented 10 years ago

the test script is basically going to try to run every single parameter possible in like 30 seconds. I'll find some sort of library to manage saving web audio streams. then we make a "green" version of the recording that we agree is totally functional. When running the test, the script would play through using the new code and record the test stream. At the end, it would play back both recordings simultaneously so any discrepancies should be apparent.

its a bit dependent on setIntervals/timeOuts being fired on time, but I think at the very least automating the "press every single button" aspect would make things easier.

coleww commented 10 years ago

ahhh and I will add an example to the Readme soon