4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JUCE 4.3.0以降でMulti Busプラグインを作成する

Posted at

Producerで作成したProjectのProjet Settingsに{0,2}, {0,4}などと書いても思った通りには反映されないので、コードで対応する必要がある。

  1. Producerで作成したProjectのProject SettingsでPlugin Channel Configurationsを空白(empty)にする。
  2. AudioProcessorを継承したクラスのコンストラクタで下記のようにbusを足していく。この例ではMain Outの他にAux Outを追加。
  3. isBusesLayoutSupported()をオーバーライドしてbusの有効性をチェックするコードを追加。
SampleAudioProcessor::SampleAudioProcessor()
# ifndef JucePlugin_PreferredChannelConfigurations
     : AudioProcessor (BusesProperties()
                     #if ! JucePlugin_IsMidiEffect
                      #if ! JucePlugin_IsSynth
                       .withInput  ("Input",  AudioChannelSet::stereo(), true)
                      #endif
                       .withOutput ("Main Out", AudioChannelSet::stereo(), true)
                       .withOutput ("Aux Out",  AudioChannelSet::stereo(), true)
                     #endif
                       )
# endif
{
}

# ifndef JucePlugin_PreferredChannelConfigurations
bool SampleAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
  #if JucePlugin_IsMidiEffect
    ignoreUnused (layouts);
    return true;
  #else
    // This is the place where you check if the layout is supported.
    // In this template code we only support mono or stereo.
    if (layouts.getChannelSet(false, 0) != AudioChannelSet::stereo())
        return false;

    if (layouts.outputBuses.size() == 2)
    {
        if (layouts.getChannelSet(false, 1) != AudioChannelSet::stereo())
            return false;
    }
    
    // This checks if the input layout matches the output layout
   #if ! JucePlugin_IsSynth
    if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
        return false;
   #endif

    return true;
  #endif
}
# endif

うまくできてればこのようになる。
sample1.png

sample2.png sample3.png
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?