Skip to content

Commit

Permalink
fixed bug in LFO
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieroberts committed Apr 3, 2012
1 parent 30e2517 commit a5ef505
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions js/gibber/gibber.js
Expand Up @@ -495,15 +495,13 @@ function Osc(freq, vol) {

if(typeof arguments[0] === "object") {
var obj = arguments[0];
console.log(obj);
for(key in obj) {
console.log("setting " + key);
that[key] = obj[key];
}
that.amp = (typeof that.amp === "undefined") ? .3 : that.amp;
}else{
that.frequency = (typeof args[0] !== "undefined") ? args[0] : 440;
that.amp = (typeof args[1] !== "undefined") ? args[1] : .2;
that.frequency = (typeof arguments[0] !== "undefined") ? arguments[0] : 440;
that.amp = (typeof arguments[1] !== "undefined") ? arguments[1] : .2;
}

that.type = "gen";
Expand Down Expand Up @@ -558,10 +556,11 @@ function Osc(freq, vol) {
}

function LFO(freq, amount, shape, type) {
var that = Osc(arguments, false);
that.isControl = true;
var that = Osc.apply(null, arguments).silent();
that.name = "LFO";
that.type = "mod";

that.isControl = false;
that.mix = amount;
that.waveShape = (typeof shape === "String") ? shape : 'sine';
that.modded = [];
Expand Down

0 comments on commit a5ef505

Please sign in to comment.