diff --git a/Source/Processors/ChannelMappingNode.cpp b/Source/Processors/ChannelMappingNode.cpp index 419d4c0c5a03a7c47a4ab6bce131729fa80f654d..4388f0879c3066987a902ef5e4a39202dba35e64 100644 --- a/Source/Processors/ChannelMappingNode.cpp +++ b/Source/Processors/ChannelMappingNode.cpp @@ -32,6 +32,13 @@ ChannelMappingNode::ChannelMappingNode() { referenceArray.resize(1024); // make room for 1024 channels channelArray.resize(1024); + + for (int i = 0; i < referenceArray.size(); i++) + { + referenceArray.set(i, -1); + channelArray.set(i, i); + } + } ChannelMappingNode::~ChannelMappingNode() @@ -54,6 +61,7 @@ void ChannelMappingNode::updateSettings() { if (getNumInputs() > 0) channelBuffer.setSize(getNumInputs(), 10000); + } @@ -75,10 +83,10 @@ void ChannelMappingNode::process(AudioSampleBuffer& buffer, int& nSamples) { - // copy everything into the channel buffer - channelBuffer.setDataToReferTo(buffer.getArrayOfChannels(), - buffer.getNumChannels(), - buffer.getNumSamples()); + // use copy constructor to set the data to refer to + channelBuffer = buffer; //.setDataToReferTo(buffer.getArrayOfChannels(), + // buffer.getNumChannels(), + // buffer.getNumSamples()); // copy it back into the buffer according to the channel mapping buffer.clear();