Permalink
Browse files

Merge branch 'master' into granulator

* master:
  Added TODOs prior to merge.
  Basic unit tests for flock.ugen.filter(). Some still failing due to inappropriate test data.
  Fixes failing audiofile tests. flock.generate.constantBuffer has been moved  back into test-utils, since it is only used by unit tests so far..
  Adds basic unit tests for filter coefficient calculators.
  Improves flock.ugen.filter to take user-configured IIR and FIR orders.
  Minor improvements to coefficient efficiency.
  Refactored Butterworth filter ugen to be a generalized biquad filter engine. Implemented generic FIR/IIR filter engine using the DSP API (still needs some fixes). Added RBJ filter coefficients to the existing  Butterworth coefficients (this means we now have resonant filters).
  Rough implementation of dspapi-based biquad filters.
  Adds flock.ugen.math() for basic math operations powered by dspapi.js

Conflicts:
	flocking/flocking-ugens.js
	tests/flocking/js/flocking-test-utils.js
	tests/flocking/js/ugen-test.js
  • Loading branch information...
2 parents df6eeeb + a60b28e commit 4f17d214ee87e0544f9a46fa1cb53835d46330c1 @colinbdclark committed Jan 7, 2013
@@ -10,6 +10,7 @@
<script src="../lib/ace_0.2.0/ace.js" charset="utf-8"></script>
<script src="../lib/ace_0.2.0/theme-twilight.js" charset="utf-8"></script>
<script src="../lib/ace_0.2.0/mode-javascript.js" charset="utf-8"></script>
+ <script src="../../../third-party/dspapi/js/dspapi.js"></script>
<script src="../../../flocking/flocking-core.js"></script>
<script src="../../../flocking/flocking-parser.js"></script>
@@ -679,7 +680,7 @@
</script>
<script type="application/flocking" id="lowpass">
var synth = flock.synth({
- ugen: "flock.ugen.filter.butter.lp",
+ ugen: "flock.ugen.filter.biquad.lp",
freq: {
ugen: "flock.ugen.sin",
rate: "control",
@@ -697,13 +698,13 @@
source: {
ugen: "flock.ugen.lfSaw",
freq: 200,
- mul: 0.25
+ mul: 0.1
}
});
</script>
<script type="application/flocking" id="highpass">
var synth = flock.synth({
- ugen: "flock.ugen.filter.butter.hp",
+ ugen: "flock.ugen.filter.biquad.hp",
freq: {
ugen: "flock.ugen.sin",
rate: "control",
@@ -721,41 +722,47 @@
source: {
ugen: "flock.ugen.lfSaw",
freq: 200,
- mul: 0.25
+ mul: 0.1
}
});
</script>
<script type="application/flocking" id="bandpass">
var synth = flock.synth({
- ugen: "flock.ugen.filter.butter.bp",
+ ugen: "flock.ugen.filter.biquad.bp",
freq: {
ugen: "flock.ugen.mouse.cursor",
+ options: {
+ interpolation: "exponential"
+ },
mul: 10000,
add: 100,
lag: 1
},
- bandwidth: 1350,
+ q: 3.0,
source: {
ugen: "flock.ugen.lfSaw",
freq: 200,
- mul: 0.25
+ mul: 0.1
}
});
</script>
<script type="application/flocking" id="bandreject">
var synth = flock.synth({
- ugen: "flock.ugen.filter.butter.br",
+ ugen: "flock.ugen.filter.biquad.br",
freq: {
ugen: "flock.ugen.mouse.cursor",
+ options: {
+ interpolation: "exponential"
+ },
mul: 10000,
add: 100,
lag: 1
},
- bandwidth: 1350,
+ q: 3.0,
source: {
ugen: "flock.ugen.lfSaw",
freq: 200,
- mul: 0.25
+ mul: 0.1
}
});
</script>
@@ -19,7 +19,7 @@ var flock = flock || {};
flock.OUT_UGEN_ID = "flocking-out";
flock.TWOPI = 2.0 * Math.PI;
- flock.LOG1 = Math.log(0.1);
+ flock.LOG01 = Math.log(0.1);
flock.LOG001 = Math.log(0.001);
flock.ROOT2 = Math.sqrt(2);
@@ -290,7 +290,7 @@ var flock = flock || {};
};
flock.invoke = function (root, path, args) {
- var fn = flock.get(root, path);
+ var fn = typeof (root) === "function" ? root : flock.get(root, path);
if (typeof (fn) !== "function") {
throw new Error("Path '" + path + "' does not resolve to a function.");
}
Oops, something went wrong.

0 comments on commit 4f17d21

Please sign in to comment.