# Mono/stereo issue in Logic/LogicX

**URL:** <https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887>\
**Category:** Audio Plugins\
**Created:** [March 9, 2016, 11:23am UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887 "2016-03-09T11:23:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![siedschl](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@siedschl](https://forum.juce.com/u/siedschl)\
**Post date:** [March 9, 2016, 11:23am UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887/1 "2016-03-09T11:23:57Z")

</div>

Using the latest tip here... and the stickied solution for the bus arrangement for a {1,1},{1,2},{2,2} effect. Here's the issue: I route a mono track with a mono sample to a stereo bus, on which I load my plugin. Using

```
if (numInputChannels == 1)
    {
        channelData0 = buffer.getWritePointer(0);
        channelData1 = buffer.getWritePointer(0);
    }
    else if (numInputChannels == 2)
    {
        channelData0 = buffer.getWritePointer(0);
        channelData1 = buffer.getWritePointer(1);
    }
```

to access the data pointers, I see that, first of all, numInputChannels (and numOutputChannels, for that matter) is 2, as expected on a stereo bus. However, channelData0 and channelData1 point to the same address, so that the effect plays back in mono! Seems like there is an issue in the AU wrapper for this case?

&nbsp;

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [March 9, 2016, 2:11pm UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887/2 "2016-03-09T14:11:59Z")

</div>

Can you post some more complete code? Where are you getting numInputChannels channles from?

---

<div class="post-metadata">

**Author:** ![siedschl](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@siedschl](https://forum.juce.com/u/siedschl)\
**Post date:** [March 9, 2016, 2:35pm UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887/3 "2016-03-09T14:35:33Z")

</div>

Sure:

```
void Processor::processBlock(AudioSampleBuffer& buffer, MidiBuffer& /*midiMessages*/)
{
    const int numInputChannels = getTotalNumInputChannels();
    const int numOutputChannels = getTotalNumOutputChannels();
    float* channelData0 = nullptr;
    float* channelData1 = nullptr;
    if (numInputChannels == 1)
    {
        channelData0 = buffer.getWritePointer(0);
        channelData1 = buffer.getWritePointer(0);
    }
    else if (numInputChannels == 2)
    {
        channelData0 = buffer.getWritePointer(0);
        channelData1 = buffer.getWritePointer(1);
    }
```

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![ckk](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@ckk](https://forum.juce.com/u/ckk)\
**Post date:** [March 9, 2016, 3:02pm UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887/4 "2016-03-09T15:02:00Z")

</div>

I remember running into this, too (although I tought the two channels pointing to the same data happened after switching from mono to stereo and back to mono). I’m rather sure I tracked this back in the AU wrapper and this issue/feature originates from Logic, e.g. Logic already provided two channels which point to the same audio data.

---

<div class="post-metadata">

**Author:** ![siedschl](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@siedschl](https://forum.juce.com/u/siedschl)\
**Post date:** [March 9, 2016, 3:05pm UTC](https://forum.juce.com/t/mono-stereo-issue-in-logic-logicx/16887/5 "2016-03-09T15:05:52Z")

</div>

Yes, when feeding a mono signal into a stereo bus, Logic provides (as input) two channels that point to the same audio data. The issue is that this collides with the way that JUCE uses the same pointers for in- and output purposes.
