Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Developer Forum

Reply
 
Thread Tools Display Modes
Old 07-20-2017, 01:13 PM   #1
RDan
Human being with feelings
 
Join Date: Jul 2017
Posts: 2
Default VST/JUCE: Reaper's odd channel request behavior for 10 channels

Hey!

I am currently working on some Ambisonics plugins using the JUCE framework and i want them to automatically set the right Ambisonic order depending on the current bus size.
To clarify: different Ambisonic orders need a different number of channels: nCh = (order+1)^2 for 3D Ambisonics

This works quite nicely when "inform plug-in when track channel count changes" is activated for the plugin ( '+' ->' compatibility settings'). If so, each time the track's number of channels gets changed, Reaper sends a effSetSpeakerArrangement message to the plugin requesting a VstSpeakerArrangement with specific type and number of channel (e.g. for 2 channels: type = 1 (stereo), numChannels = 2).

But here is the problem: when i choose "10 channels" for the track, Reaper sends a request for type = 28 (this is kSpeakerArr102, using 12 channels) and a numChannels 10. As kSpeakerArr102 having 12 speakers, the plugin sends 0 (rejecting the request due to the numChannel mismatch) and Reaper starts another request for type = -2 (user defined, so everything possible) and a numChannel 64. As a result, my plugin sets the Ambisonics order to 7 ((7+1)^2 = 64).

For every other channel count, the speakerArrangementType request by reaper matches the requested numChannels. For higher numbers like 54, reaper sends - correctly - a user defined request (type -2), as there's no layout with 54 speakers.

So in my opinion this is a quite odd behavior, requesting a non-conform speakerArrangementType-numChannels-pair.

Is there a reason behind that? Or is it a bug, maybe a wrong line of code as type=28 would be correct for 12 channels (next to 10)?

Regards
Daniel
RDan is offline   Reply With Quote
Old 07-21-2017, 07:23 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,465
Default

We send kSpeakerArr102 for anything 9-12 channels, since the VST spec doesn't define speaker arrangements for 10 channels. The numChannels field of VstSpeakerArrangement is probably the best choice for determining the exact channel count when you receive a kSpeakerArr102?

Though I see your point, we should probably send kSpeakerArrUserDefined for 10 channel mode too. Hmm.
Justin is online now   Reply With Quote
Old 07-21-2017, 03:26 PM   #3
RDan
Human being with feelings
 
Join Date: Jul 2017
Posts: 2
Default

Quote:
Originally Posted by Justin View Post
The numChannels field of VstSpeakerArrangement is probably the best choice for determining the exact channel count when you receive a kSpeakerArr102? .
Indeed, especially because my Ambisonics Plugins don't care about SpeakerArrangement types But intercepting the kSpeakerArr102 would involve changing the JUCE VST rapper (every time there's a new JUCE update).

Quote:
Originally Posted by Justin View Post
Though I see your point, we should probably send kSpeakerArrUserDefined for 10 channel mode too. Hmm.
I would appreciate this option a lot!
RDan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.