Skip to content

Sound decoding demo in web version#6

Open
3jins wants to merge 1 commit intomasterfrom
review/sejin/1
Open

Sound decoding demo in web version#6
3jins wants to merge 1 commit intomasterfrom
review/sejin/1

Conversation

@3jins
Copy link
Copy Markdown
Member

@3jins 3jins commented Jan 21, 2018

ㅈㄱㄴ

@3jins 3jins self-assigned this Jan 21, 2018
Comment thread web_demo/index.html
</head>
<body>

<h1>개발자도구(F12) 열어서 콘솔에 로그 찍히는걸로 확인하삼</h1>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not nessasary.

Comment thread web_demo/index.html
<head>
<meta charset="utf-8">
<title>Pitch Detector</title>
<!--<link href='http://fonts.googleapis.com/css?family=Alike' rel='stylesheet' type='text/css'>-->
Copy link
Copy Markdown
Contributor

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.

Comment thread web_demo/index.html
<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>
Copy link
Copy Markdown
Contributor

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.

Comment thread web_demo/js/main.js
}

window.onload = function () {
console.log(
Copy link
Copy Markdown
Contributor

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) {
/**
Copy link
Copy Markdown
Contributor

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.
Copy link
Copy Markdown
Contributor

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;
Copy link
Copy Markdown
Contributor

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()
Copy link
Copy Markdown
Contributor

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() {
Copy link
Copy Markdown
Contributor

@happy-nut happy-nut Jan 25, 2018

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;
Copy link
Copy Markdown
Contributor

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];
Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants