Open
Conversation
happy-nut
reviewed
Jan 25, 2018
| </head> | ||
| <body> | ||
|
|
||
| <h1>개발자도구(F12) 열어서 콘솔에 로그 찍히는걸로 확인하삼</h1> |
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Pitch Detector</title> | ||
| <!--<link href='http://fonts.googleapis.com/css?family=Alike' rel='stylesheet' type='text/css'>--> |
Contributor
There was a problem hiding this comment.
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> |
Contributor
There was a problem hiding this comment.
if these files are related in dependency of loading sequence, It would be great to comment about it.
| } | ||
|
|
||
| window.onload = function () { | ||
| console.log( |
| @@ -0,0 +1,49 @@ | |||
| var PitchUpdater = function(audioContext) { | |||
| /** | |||
Contributor
There was a problem hiding this comment.
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. |
| if (bestCorrelation > 0.01) { | ||
| return sampleRate / bestOffset; | ||
| } | ||
| return -1; |
| pitchElem = document.getElementById( "pitch" ); | ||
| noteElem = document.getElementById( "note" ); | ||
|
|
||
| toggleLiveInput() |
Contributor
There was a problem hiding this comment.
toggleLiveInput(); for the clear code.
| } | ||
|
|
||
|
|
||
| function toggleLiveInput() { |
Contributor
There was a problem hiding this comment.
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; |
happy-nut
reviewed
Jan 25, 2018
| detectorElem.className = "confident"; | ||
| pitchElem.innerText = Math.round( pitch ) ; | ||
| var note = noteFromPitch( pitch ); | ||
| noteElem.innerHTML = noteStrings[note % 12]; |
Contributor
There was a problem hiding this comment.
why don't you replace 12 to noteString.length
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ㅈㄱㄴ