jackschaedler / circles-sines-signals

A Compact Primer on Digital Signal Processing
982 stars 86 forks source link

Unit circle digrams not interactive #14

Closed mgold closed 9 years ago

mgold commented 9 years ago

http://jackschaedler.github.io/circles-sines-signals/trig_review.html

The slider seems to trigger Uncaught ReferenceError: GET_TRIG_PHASE is not defined and the digram does not change in response. Possibly related to #2. If it worked before, it's probably an easy fix.

jackschaedler commented 9 years ago

Thanks for the issue. Which browser are you using when you see this behavior?

mgold commented 9 years ago

Chrome 41, Yosemite.... but it seems to be working now and nothing is logged to the console. #2 is also working for me again (except I can't hear the sound? Quite possibly a fluke on my end.).

Closing as it works now. Hopefully you changed something rather than it being intermittent.

justinlevi commented 9 years ago

@jackschaedler @mgold I believe this issue should be reopened actually. I'm attaching a screen capture image showing the issue still on the latest mac chrome. I'm also uploading a screen capture video to dropbox (link below)

https://dl.dropboxusercontent.com/u/12722991/circles-signes-signals.mp4

screen shot 2015-05-16 at 8 52 09 am

I think this is a race condition where the GET_TRIG_PHASE() is not being defined in time at the bottom of trig_review.html on line 144.

phasor_trig.js is being included on line 98 so it might be possible for the draw function on line 246 to fire prior to the variable declarations at the bottom of the html

mgold commented 9 years ago

That's a really compelling explanation and an excellent reproduction. Setting a breakpoint to defeat a race condition - neat trick. Also: I'm not crazy!

I was able to load the page fine once but now I am getting the error again.

I guess the simplest solution would be to package everything in one file using browserify or similar?

jackschaedler commented 9 years ago

Just pushed a quick fix. Would be great if you all could give it a test!

mgold commented 9 years ago

Seems good, but of course it's hard to know for sure.

justinlevi commented 9 years ago

Finally had a minute to check this out. All looks good on this end.

jackschaedler commented 9 years ago

Ok, thanks everyone! I'm going to close this for now.