Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Binaural4: file path assertion added

  • Loading branch information...
commit 4cf129010bae492d720393329ddcc429c3a78657 1 parent cba70b5
@hoch hoch authored
Showing with 23 additions and 6 deletions.
  1. +21 −4 binaural/Binaural4.ck
  2. +2 −2 panning/DBAP4e.ck
View
25 binaural/Binaural4.ck
@@ -5,16 +5,25 @@
// the speakers.
// @note Plug headphones into dac.chan(0-1) and start it after
// it's started, other shreds can send their signals to
-// pssp[0-3] which are the "psuedo speakers" in quad
+// input[0-3] which are the "psuedo speakers" in quad
// formation. Impulse responses were made from each speaker
// to each ear using the nearfield quad setup in the CCRMA
// ballroom with help from Jonathan Abel.
// @version chuck-1.3.1.3 / ma-0.2.2c
-// @revision 7
+// @revision 8
-// name:: Binaural4
-// desc:: 4-channel binaural mixer
+// sanity check
+FileIO f;
+me.sourceDir() + "/ir/ccrma-ballroom/" => string p;
+f.open(p + "LeftFront_L.wav", FileIO.READ);
+if (!f.good()) {
+ cherr <= "[Binaural4] Check your IR file path. Can't load Binaural4.\n";
+ me.exit();
+}
+
+
+// @class Binaural4 4-channel binaural mixer
public class Binaural4
{
// NOTE: download a zipped IR file and extract into the same
@@ -32,6 +41,14 @@ public class Binaural4
@=> string _channels[];
_channels.cap() => int _numChannels;
+ // sanity check
+ FileIO _f;
+ _f.open(_path + _channels[0] + "_L.wav", FileIO.READ);
+ if (!_f.good()) {
+ cherr <= "[Binaural4] Check your IR file path. Can't open files.\n";
+ me.exit();
+ }
+
// mixer input: inlets exposed aka psuedo speakers
Gain input[4];
View
4 panning/DBAP4e.ck
@@ -16,10 +16,10 @@ public class DBAP4e extends Chubgraph
// warning
if (dac.channels() < 4) {
- cherr <= "[DBAP4] Insufficient output ports - using binaural mixdown.\n";
+ cherr <= "[DBAP4e] Insufficient output ports - using binaural mixdown.\n";
1 => _BINAURAL;
} else {
- cherr <= "[DBAP4] Using 4-channel configuration.\n";
+ cherr <= "[DBAP4e] Using 4-channel configuration.\n";
}
// position of speakers: LF, RF, LR, RR (Z-config)
Please sign in to comment.
Something went wrong with that request. Please try again.