I have a plugin that works as mono->mono, mono->stereo, and stereo->stereo. When I drag a mono audio file into Reaper and then insert my plugin, I get two channels of audio going through the plugin. I have this AudioProcessor constructor:
Am I missing something? It only happens with Reaper. Mono works fine in PT and other DAWs as far as I know. My plugin has different processing for mono vs stereo, so today it incorrectly assumes stereo processing because it only knows getTotalNumInputChannels() is 2 and getTotalNumOutputChannels() is 2.
It seems that Reaper always processes at least 2 channels per track. If it plays a mono file, it just sends the same information to channels 1&2 and CPU is wasted by processing the same thing twice. I’d be happy if any Reaper expert could prove me wrong, but I think that’s just the way things are - same “Problem” with Ableton Live.
In the past some plugin manufacturers have offered specific mono versions that only process the data once, but IMHO this makes matters even more confusing and clogs up plugin menus.
Yes, this is how it works. It’s been an issue discussed by Reaper users for a long time, but it seems Cockos is not interested in changing how it works. (Probably because Reaper allows putting files of varying channel counts on the same track and it would further complicate things if the plugins would have to change their channel counts on the fly depending on the type of file currently played on the track.)
Thanks for the replies. I was worried this would be the answer. I have no way around the fact that my processing is different for mono vs stereo. So, if you know of an API way to figure out that the track is really mono (even though the plugin is receiving two channels of audio), let me know. The only thing I can think of is to compare samples between the two audio streams and assume it is mono if they are exactly the same. But corner cases like silent audio probably cause trouble for that idea.
edit: to clarify one point - if I know the track is mono even though I am receiving two audio streams, then I can just process one stream and then copy that to both outgoing streams.