Skip to content

Commit

Permalink
Binaural4: file path assertion added
Browse files Browse the repository at this point in the history
  • Loading branch information
hoch committed Nov 2, 2012
1 parent cba70b5 commit 4cf1290
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
25 changes: 21 additions & 4 deletions binaural/Binaural4.ck
Expand Up @@ -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
Expand All @@ -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];

Expand Down
4 changes: 2 additions & 2 deletions panning/DBAP4e.ck
Expand Up @@ -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)
Expand Down

0 comments on commit 4cf1290

Please sign in to comment.