Skip to content

Commit

Permalink
More color palettes, tweaking gain
Browse files Browse the repository at this point in the history
  • Loading branch information
deanputney committed Nov 14, 2013
1 parent b1b9930 commit 4a8c54e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Spectrum.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Spectrum = {
gain: 1,
gainFactor: 1,
gainTweak: 0,
timeStep: function()
{
if (this._analyserNode == null) { return }
Expand All @@ -12,7 +12,7 @@ Spectrum = {
var bins = []
for (var i = 0; i < this._analyserNode.frequencyBinCount; i ++)
{
bins.push(freqByteData[i]*this.gain*this.gainFactor)
bins.push(freqByteData[i]*(this.gain+this.gainTweak))
}

return bins
Expand Down
18 changes: 9 additions & 9 deletions hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ $(document).bind('keydown', '1', function(e) {
});

$(document).bind('keydown', '2', function(e) {
Spectrum.gain = 2;
Spectrum.gain = 1.5;
});

$(document).bind('keydown', '3', function(e) {
Spectrum.gain = 3;
Spectrum.gain = 2;
});

$(document).bind('keydown', '4', function(e) {
Spectrum.gain = 4;
Spectrum.gain = 2.5;
});

$(document).bind('keydown', '5', function(e) {
Spectrum.gain = 5;
Spectrum.gain = 3;
});

$(document).bind('keydown', '6', function(e) {
Spectrum.gain = 10;
Spectrum.gain = 5;
});

$(document).bind('keydown', '7', function(e) {
Spectrum.gain = 20;
Spectrum.gain = 0;
});

$(document).bind('keydown', '8', function(e) {
Expand All @@ -44,12 +44,12 @@ $(document).bind('keyup', '9', function(e) {


$(document).bind('keydown', 'o', function(e) {
Spectrum.gainFactor -= .05;
Spectrum.gainTweak -= .05;
});

$(document).bind('keydown', 'p', function(e) {
console.log(Spectrum.gainFactor);
Spectrum.gainFactor += 0.05;
console.log(Spectrum.gainTweak);
Spectrum.gainTweak += 0.05;
});


Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
new Array('#71c8bf', '#1ba554', '#cad93b', '#fef02f', '#fbb62c', '#f38a2e', '#ee592c', '#ea1d2b', '#b42767', '#65328f', '#52529f', '#20aeda'),
new Array('#e20ea3', '#0ef7f3', '#1dfc16', '#f41186', '#cdff07'),
new Array('#003de8', '#3f71fc', '#0c9eff', '#3fc8ea', '#4be5db'),
new Array('#20fcd3', '#8be223', '#f9b727', '#e22917', '#952efc'),
new Array('#a3a948', '#edb92e', '#f85931', '#ce1836', '#009989'),
new Array('#00a8c6', '#40c0cb', '#f9f2e7', '#aee239', '#8fbe00')
new Array('#00a8c6', '#40c0cb', '#f9f2e7', '#aee239', '#8fbe00'),
new Array('#3bff90', '#2c00ff', '#1b66f5', '#92f51b', '#ff00dd'),
new Array('#aaff00', '#ffaa00', '#ff00aa', '#aa00ff', '#00aaff')
]

//PI = 3.14159265359
Expand Down

0 comments on commit 4a8c54e

Please sign in to comment.