-
Notifications
You must be signed in to change notification settings - Fork 0
Sound decoding demo in web version #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| </head> | ||
| <body> | ||
|
|
||
| <h1>개발자도구(F12) 열어서 콘솔에 로그 찍히는걸로 확인하삼</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not nessasary.
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Pitch Detector</title> | ||
| <!--<link href='http://fonts.googleapis.com/css?family=Alike' rel='stylesheet' type='text/css'>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz delete unused code or unrelated comments.
| <script src="js/pitch/PitchUpdater.js"></script> | ||
| <script src="js/pitch/SoundDecoder.js"></script> | ||
| <script src="js/pitch/UserMediaStarter.js"></script> | ||
| <script src="js/main.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if these files are related in dependency of loading sequence, It would be great to comment about it.
| } | ||
|
|
||
| window.onload = function () { | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not nessasary
| @@ -0,0 +1,49 @@ | |||
| var PitchUpdater = function(audioContext) { | |||
| /** | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz move this comment to line 1.
| bestOffset = offset; | ||
| } | ||
| } else if (foundGoodCorrelation) { | ||
| // short-circuit - we found a good correlation, then a bad one, so we'd just be seeing copies from here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use /**/
| if (bestCorrelation > 0.01) { | ||
| return sampleRate / bestOffset; | ||
| } | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not bestOffset?
| pitchElem = document.getElementById( "pitch" ); | ||
| noteElem = document.getElementById( "note" ); | ||
|
|
||
| toggleLiveInput() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toggleLiveInput(); for the clear code.
| } | ||
|
|
||
|
|
||
| function toggleLiveInput() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code seems not execute anything. Do we need this to be a function?
|
|
||
| function noteFromPitch( frequency ) { | ||
| var noteNum = 12 * (Math.log( frequency / 440 )/Math.log(2) ); | ||
| return Math.round( noteNum ) + 69; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 69?
| detectorElem.className = "confident"; | ||
| pitchElem.innerText = Math.round( pitch ) ; | ||
| var note = noteFromPitch( pitch ); | ||
| noteElem.innerHTML = noteStrings[note % 12]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you replace 12 to noteString.length
ㅈㄱㄴ