{"action":"created","comment":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/202221205","pull_request_review_id":136879476,"id":202221205,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjIyMTIwNQ==","diff_hunk":"@@ -515,30 +518,63 @@ function usernameFromIDReply(id, username, machineFingerprint, isAdmin) {\n     updateUser(data);\n }\n \n+function updateAudioLevel(overlay, avatarData) {\n+    // the VU meter should work similarly to the one in AvatarInputs: log scale, exponentially averaged\n+    // But of course it gets the data at a different rate, so we tweak the averaging ratio and frequency\n+    // of updating (the latter for efficiency too).\n+    var audioLevel = 0.0;\n+    var avgAudioLevel = 0.0;\n+\n+    if (overlay) {\n+        // we will do exponential moving average by taking some the last loudness and averaging\n+        overlay.accumulatedLevel = AVERAGING_RATIO * (overlay.accumulatedLevel || 0) + (1 - AVERAGING_RATIO) * (avatarData.audioLoudness);\n+\n+        // add 1 to insure we don't go log() and hit -infinity.  Math.log is\n+        // natural log, so to get log base 2, just divide by ln(2).\n+        audioLevel = scaleAudio(Math.log(overlay.accumulatedLevel + 1) / LOG2);\n+\n+        // decay avgAudioLevel\n+        avgAudioLevel = Math.max((1 - AUDIO_PEAK_DECAY) * (overlay.avgAudioLevel || 0), audioLevel);\n+\n+        overlay.avgAudioLevel = avgAudioLevel;\n+        overlay.audioLevel = audioLevel;\n+\n+        // now scale for the gain.  Also, asked to boost the low end, so one simple way is\n+        // to take sqrt of the value.  Lets try that, see how it feels.\n+        avgAudioLevel = Math.min(1.0, Math.sqrt(avgAudioLevel * (sessionGains[avatarData.sessionUUID] || 0.75)));\n+    } else {\n+        audioLevel = scaleAudio(Math.log(((1 - AVERAGING_RATIO) * (avatarData.audioLoudness)) + 1) / LOG2);\n+    }\n+\n+    var param = {};\n+    var level = [audioLevel, avgAudioLevel];\n+    var userId = avatarData.sessionUUID === MyAvatar.sessionUUID ? 0 : avatarData.sessionUUID;","path":"scripts/system/pal.js","position":88,"original_position":88,"commit_id":"fa518b995aad602c4c483f6470a5880d46b4f151","original_commit_id":"fa518b995aad602c4c483f6470a5880d46b4f151","user":{"login":"howard-stearns","id":7015115,"node_id":"MDQ6VXNlcjcwMTUxMTU=","avatar_url":"https://avatars2.githubusercontent.com/u/7015115?v=4","gravatar_id":"","url":"https://api.github.com/users/howard-stearns","html_url":"https://github.com/howard-stearns","followers_url":"https://api.github.com/users/howard-stearns/followers","following_url":"https://api.github.com/users/howard-stearns/following{/other_user}","gists_url":"https://api.github.com/users/howard-stearns/gists{/gist_id}","starred_url":"https://api.github.com/users/howard-stearns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howard-stearns/subscriptions","organizations_url":"https://api.github.com/users/howard-stearns/orgs","repos_url":"https://api.github.com/users/howard-stearns/repos","events_url":"https://api.github.com/users/howard-stearns/events{/privacy}","received_events_url":"https://api.github.com/users/howard-stearns/received_events","type":"User","site_admin":false},"body":"What do you think about doing the math in getPalData? (In C++)","created_at":"2018-07-13T01:10:57Z","updated_at":"2018-07-13T01:10:58Z","html_url":"https://github.com/highfidelity/hifi/pull/13602#discussion_r202221205","pull_request_url":"https://api.github.com/repos/highfidelity/hifi/pulls/13602","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/202221205"},"html":{"href":"https://github.com/highfidelity/hifi/pull/13602#discussion_r202221205"},"pull_request":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/13602"}}},"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/13602","id":201141887,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMTQxODg3","html_url":"https://github.com/highfidelity/hifi/pull/13602","diff_url":"https://github.com/highfidelity/hifi/pull/13602.diff","patch_url":"https://github.com/highfidelity/hifi/pull/13602.patch","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/13602","number":13602,"state":"open","locked":false,"title":"Fix MS16562: Massive PAL speedup!","user":{"login":"zfox23","id":3409031,"node_id":"MDQ6VXNlcjM0MDkwMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/3409031?v=4","gravatar_id":"","url":"https://api.github.com/users/zfox23","html_url":"https://github.com/zfox23","followers_url":"https://api.github.com/users/zfox23/followers","following_url":"https://api.github.com/users/zfox23/following{/other_user}","gists_url":"https://api.github.com/users/zfox23/gists{/gist_id}","starred_url":"https://api.github.com/users/zfox23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfox23/subscriptions","organizations_url":"https://api.github.com/users/zfox23/orgs","repos_url":"https://api.github.com/users/zfox23/repos","events_url":"https://api.github.com/users/zfox23/events{/privacy}","received_events_url":"https://api.github.com/users/zfox23/received_events","type":"User","site_admin":false},"body":"Attempts to fix [MS16562](https://highfidelity.fogbugz.com/f/cases/16562/Reports-of-PAL-performance-tanking-when-many-people-are-in-the-area) by implementing some optimizations to hugely speedup the PAL.\r\n\r\nDNM for now until a bunch of people test it out.","created_at":"2018-07-12T22:23:12Z","updated_at":"2018-07-13T01:10:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a9326cb95816794ccf25b24552144fbcdac9a73","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":278736632,"node_id":"MDU6TGFiZWwyNzg3MzY2MzI=","url":"https://api.github.com/repos/highfidelity/hifi/labels/DO%20NOT%20MERGE","name":"DO NOT MERGE","color":"e11d21","default":false},{"id":415249994,"node_id":"MDU6TGFiZWw0MTUyNDk5OTQ=","url":"https://api.github.com/repos/highfidelity/hifi/labels/Discovery","name":"Discovery","color":"fef2c0","default":false},{"id":313595519,"node_id":"MDU6TGFiZWwzMTM1OTU1MTk=","url":"https://api.github.com/repos/highfidelity/hifi/labels/QA%20Ready","name":"QA Ready","color":"bfd4f2","default":false},{"id":11332862,"node_id":"MDU6TGFiZWwxMTMzMjg2Mg==","url":"https://api.github.com/repos/highfidelity/hifi/labels/bug","name":"bug","color":"fc2929","default":true}],"milestone":{"url":"https://api.github.com/repos/highfidelity/hifi/milestones/31","html_url":"https://github.com/highfidelity/hifi/milestone/31","labels_url":"https://api.github.com/repos/highfidelity/hifi/milestones/31/labels","id":3290830,"node_id":"MDk6TWlsZXN0b25lMzI5MDgzMA==","number":31,"title":"RC71","description":"","creator":{"login":"conklin94122","id":12115653,"node_id":"MDQ6VXNlcjEyMTE1NjUz","avatar_url":"https://avatars2.githubusercontent.com/u/12115653?v=4","gravatar_id":"","url":"https://api.github.com/users/conklin94122","html_url":"https://github.com/conklin94122","followers_url":"https://api.github.com/users/conklin94122/followers","following_url":"https://api.github.com/users/conklin94122/following{/other_user}","gists_url":"https://api.github.com/users/conklin94122/gists{/gist_id}","starred_url":"https://api.github.com/users/conklin94122/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conklin94122/subscriptions","organizations_url":"https://api.github.com/users/conklin94122/orgs","repos_url":"https://api.github.com/users/conklin94122/repos","events_url":"https://api.github.com/users/conklin94122/events{/privacy}","received_events_url":"https://api.github.com/users/conklin94122/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":18,"state":"open","created_at":"2018-04-23T19:27:05Z","updated_at":"2018-07-13T01:09:47Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/highfidelity/hifi/pulls/13602/commits","review_comments_url":"https://api.github.com/repos/highfidelity/hifi/pulls/13602/comments","review_comment_url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/13602/comments","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/fa518b995aad602c4c483f6470a5880d46b4f151","head":{"label":"zfox23:MS16562_massivePalSpeedup","ref":"MS16562_massivePalSpeedup","sha":"fa518b995aad602c4c483f6470a5880d46b4f151","user":{"login":"zfox23","id":3409031,"node_id":"MDQ6VXNlcjM0MDkwMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/3409031?v=4","gravatar_id":"","url":"https://api.github.com/users/zfox23","html_url":"https://github.com/zfox23","followers_url":"https://api.github.com/users/zfox23/followers","following_url":"https://api.github.com/users/zfox23/following{/other_user}","gists_url":"https://api.github.com/users/zfox23/gists{/gist_id}","starred_url":"https://api.github.com/users/zfox23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfox23/subscriptions","organizations_url":"https://api.github.com/users/zfox23/orgs","repos_url":"https://api.github.com/users/zfox23/repos","events_url":"https://api.github.com/users/zfox23/events{/privacy}","received_events_url":"https://api.github.com/users/zfox23/received_events","type":"User","site_admin":false},"repo":{"id":72575800,"node_id":"MDEwOlJlcG9zaXRvcnk3MjU3NTgwMA==","name":"hifi","full_name":"zfox23/hifi","owner":{"login":"zfox23","id":3409031,"node_id":"MDQ6VXNlcjM0MDkwMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/3409031?v=4","gravatar_id":"","url":"https://api.github.com/users/zfox23","html_url":"https://github.com/zfox23","followers_url":"https://api.github.com/users/zfox23/followers","following_url":"https://api.github.com/users/zfox23/following{/other_user}","gists_url":"https://api.github.com/users/zfox23/gists{/gist_id}","starred_url":"https://api.github.com/users/zfox23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfox23/subscriptions","organizations_url":"https://api.github.com/users/zfox23/orgs","repos_url":"https://api.github.com/users/zfox23/repos","events_url":"https://api.github.com/users/zfox23/events{/privacy}","received_events_url":"https://api.github.com/users/zfox23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zfox23/hifi","description":"Open source software for shared virtual worlds using HMDs and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.com/jobs  Documentation at http://docs.highfidelity.com  Contribute by reporting bugs & doing jobs on http://worklist.net","fork":true,"url":"https://api.github.com/repos/zfox23/hifi","forks_url":"https://api.github.com/repos/zfox23/hifi/forks","keys_url":"https://api.github.com/repos/zfox23/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zfox23/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zfox23/hifi/teams","hooks_url":"https://api.github.com/repos/zfox23/hifi/hooks","issue_events_url":"https://api.github.com/repos/zfox23/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/zfox23/hifi/events","assignees_url":"https://api.github.com/repos/zfox23/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/zfox23/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/zfox23/hifi/tags","blobs_url":"https://api.github.com/repos/zfox23/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zfox23/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zfox23/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/zfox23/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zfox23/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/zfox23/hifi/languages","stargazers_url":"https://api.github.com/repos/zfox23/hifi/stargazers","contributors_url":"https://api.github.com/repos/zfox23/hifi/contributors","subscribers_url":"https://api.github.com/repos/zfox23/hifi/subscribers","subscription_url":"https://api.github.com/repos/zfox23/hifi/subscription","commits_url":"https://api.github.com/repos/zfox23/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/zfox23/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/zfox23/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/zfox23/hifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/zfox23/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/zfox23/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zfox23/hifi/merges","archive_url":"https://api.github.com/repos/zfox23/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zfox23/hifi/downloads","issues_url":"https://api.github.com/repos/zfox23/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/zfox23/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/zfox23/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/zfox23/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zfox23/hifi/labels{/name}","releases_url":"https://api.github.com/repos/zfox23/hifi/releases{/id}","deployments_url":"https://api.github.com/repos/zfox23/hifi/deployments","created_at":"2016-11-01T20:54:04Z","updated_at":"2018-07-12T23:21:29Z","pushed_at":"2018-07-12T23:27:29Z","git_url":"git://github.com/zfox23/hifi.git","ssh_url":"git@github.com:zfox23/hifi.git","clone_url":"https://github.com/zfox23/hifi.git","svn_url":"https://github.com/zfox23/hifi","homepage":"","size":545096,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"highfidelity:master","ref":"master","sha":"b53772f9caa84fb1921dc8318d9a1d0325c31c57","user":{"login":"highfidelity","id":1565370,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjUzNzA=","avatar_url":"https://avatars0.githubusercontent.com/u/1565370?v=4","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"repo":{"id":5372872,"node_id":"MDEwOlJlcG9zaXRvcnk1MzcyODcy","name":"hifi","full_name":"highfidelity/hifi","owner":{"login":"highfidelity","id":1565370,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjUzNzA=","avatar_url":"https://avatars0.githubusercontent.com/u/1565370?v=4","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/highfidelity/hifi","description":"Open source client/server software for creating shared VR environments.  Docs at http://docs.highfidelity.com  We are hiring: http://highfidelity.com/jobs  Also, PT work available at http://worklist.net","fork":false,"url":"https://api.github.com/repos/highfidelity/hifi","forks_url":"https://api.github.com/repos/highfidelity/hifi/forks","keys_url":"https://api.github.com/repos/highfidelity/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/highfidelity/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/highfidelity/hifi/teams","hooks_url":"https://api.github.com/repos/highfidelity/hifi/hooks","issue_events_url":"https://api.github.com/repos/highfidelity/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/highfidelity/hifi/events","assignees_url":"https://api.github.com/repos/highfidelity/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/highfidelity/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/highfidelity/hifi/tags","blobs_url":"https://api.github.com/repos/highfidelity/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/highfidelity/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/highfidelity/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/highfidelity/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/highfidelity/hifi/languages","stargazers_url":"https://api.github.com/repos/highfidelity/hifi/stargazers","contributors_url":"https://api.github.com/repos/highfidelity/hifi/contributors","subscribers_url":"https://api.github.com/repos/highfidelity/hifi/subscribers","subscription_url":"https://api.github.com/repos/highfidelity/hifi/subscription","commits_url":"https://api.github.com/repos/highfidelity/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/highfidelity/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/highfidelity/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/highfidelity/hifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/highfidelity/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/highfidelity/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/highfidelity/hifi/merges","archive_url":"https://api.github.com/repos/highfidelity/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/highfidelity/hifi/downloads","issues_url":"https://api.github.com/repos/highfidelity/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/highfidelity/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/highfidelity/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/highfidelity/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/highfidelity/hifi/labels{/name}","releases_url":"https://api.github.com/repos/highfidelity/hifi/releases{/id}","deployments_url":"https://api.github.com/repos/highfidelity/hifi/deployments","created_at":"2012-08-10T18:26:22Z","updated_at":"2018-07-12T23:01:16Z","pushed_at":"2018-07-13T01:06:38Z","git_url":"git://github.com/highfidelity/hifi.git","ssh_url":"git@github.com:highfidelity/hifi.git","clone_url":"https://github.com/highfidelity/hifi.git","svn_url":"https://github.com/highfidelity/hifi","homepage":"","size":543705,"stargazers_count":635,"watchers_count":635,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":404,"mirror_url":null,"archived":false,"open_issues_count":161,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":404,"open_issues":161,"watchers":635,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/13602"},"html":{"href":"https://github.com/highfidelity/hifi/pull/13602"},"issue":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/13602"},"comments":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/13602/comments"},"review_comments":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/13602/comments"},"review_comment":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/13602/commits"},"statuses":{"href":"https://api.github.com/repos/highfidelity/hifi/statuses/fa518b995aad602c4c483f6470a5880d46b4f151"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"howard-stearns"}}