Skip to content
Browse files

Binaural4 using static again, DBAP4e fixed

  • Loading branch information...
1 parent b41ec9c commit f8143b7e250a4db749dff5270ae769bc59adde02 @hoch hoch committed Nov 3, 2012
Showing with 20 additions and 12 deletions.
  1. +14 −5 binaural/Binaural4.ck
  2. +6 −7 panning/DBAP4e.ck
View
19 binaural/Binaural4.ck
@@ -32,7 +32,7 @@ public class Binaural4
me.sourceDir() + "/ir/ccrma-ballroom/" => string _path;
// print startup message
- cherr <= "[Binaural4] Creating instance...\n";
+ cherr <= "[Binaural4] creating instance...\n";
// number of synthesized point sources which will be
// the number of speakers that produced impulse responses
@@ -42,7 +42,11 @@ public class Binaural4
_channels.cap() => int _numChannels;
// mixer input: inlets exposed aka psuedo speakers
- Gain input[4];
+ static Gain @ input[4];
+ for(0 => int i; i < 4; ++i ) {
+ new Gain @=> input[i];
+ 3.0 => input[i].gain;
+ }
// convolute each source to one ear
fun void mixSourceToEar(int channel, string ear) {
@@ -94,7 +98,7 @@ public class Binaural4
// set FFT parameters
1024 => int FFT_SIZE;
if (FFT_SIZE < irbuf.samples()) {
- cherr <= "[Binaural4] Need longer FFT size:";
+ cherr <= "[Binaural4] need longer FFT size:";
cherr <= FFT_SIZE <= irbuf.samples() <= IO.newline();
}
FFT_SIZE => X.size => Y.size;
@@ -136,7 +140,12 @@ public class Binaural4
}
// log message and start loop
- cherr <= "[Binaural4] Mixer launched successfully.\n";
+ cherr <= "[Binaural4] mixer launched successfully.\n";
} // END OF CLASS: Binaural4
-cherr <= "[Binaural4] Class definition loaded.\n";
+// instantiate and loop
+Binaural4 b;
+cherr <= "[Binaural4] binaural mixer started.\n";
+while(true) {
+ 1::day => now;
+}
View
13 panning/DBAP4e.ck
@@ -16,10 +16,10 @@ public class DBAP4e extends Chubgraph
// warning
if (dac.channels() < 4) {
- cherr <= "[DBAP4e] Insufficient output ports - using binaural mixdown.\n";
+ cherr <= "[DBAP4e] insufficient output ports - using binaural mixdown.\n";
1 => _BINAURAL;
} else {
- cherr <= "[DBAP4e] Using 4-channel configuration.\n";
+ cherr <= "[DBAP4e] using 4-channel configuration.\n";
}
// position of speakers: LF, RF, LR, RR (Z-config)
@@ -34,7 +34,6 @@ public class DBAP4e extends Chubgraph
Envelope _out[4];
DelayA _d[4];
NRev _r[4];
- Binaural4 _b4;
// initialization
inlet => _in;
@@ -44,7 +43,7 @@ public class DBAP4e extends Chubgraph
if (_BINAURAL == 0) {
_in => _out[i] => _d[i] => _r[i] => dac.chan(i);
} else {
- _in => _out[i] => _d[i] => _r[i] => _b4.input[i];
+ _in => _out[i] => _d[i] => _r[i] => Binaural4.input[i];
}
20::ms => _out[i].duration;
0.0 => _out[i].target;
@@ -90,7 +89,7 @@ public class DBAP4e extends Chubgraph
// ex) d4e.setDelayTime([0.5, 10, 5, 17]);
fun void setDelayTime(float dt[]) {
if (dt.cap() < 4) {
- cherr <= "[DBAP4e] Invalid array.\n";
+ cherr <= "[DBAP4e] invalid array.\n";
return;
} else {
for(0 => int i; i < 4; ++i) {
@@ -107,12 +106,12 @@ public class DBAP4e extends Chubgraph
}
if (mode == "plain") {
for (0 => int i; i < 4; ++i) {
- _r[i] =< _b4.input[i];
+ _r[i] =< Binaural4.input[i];
_r[i] => dac.chan(i);
}
} else if (mode == "binaural") {
for (0 => int i; i < 4; ++i) {
- _r[i] => _b4.input[i];
+ _r[i] => Binaural4.input[i];
_r[i] =< dac.chan(i);
}
}

0 comments on commit f8143b7

Please sign in to comment.
Something went wrong with that request. Please try again.