# Question about AudioProcessor

**URL:** <https://forum.juce.com/t/question-about-audioprocessor/24475>\
**Category:** Audio Plugins\
**Created:** [October 2, 2017, 6:47pm UTC](https://forum.juce.com/t/question-about-audioprocessor/24475 "2017-10-02T18:47:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cutlasses](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cutlasses/32/2919_2.png) [@cutlasses](https://forum.juce.com/u/cutlasses)\
**Post date:** [October 2, 2017, 6:47pm UTC](https://forum.juce.com/t/question-about-audioprocessor/24475/1 "2017-10-02T18:47:25Z")

</div>

I’m trying to write an audio plugin, which is essentially made up of a number of blocks or effects. (I’m trying to write something that mimics the Teensy Audio library [https://www.pjrc.com/teensy/td\_libs\_Audio.html](https://www.pjrc.com/teensy/td_libs_Audio.html)). Only one effect does anything interesting, the other effects are simply mixers that blend the outputs and deal with feedback. I have a few questions which would really help me ensure I’m using the correct JUCE classes.

1. Does it make sense to make each of these blocks an AudioProcessor? Or should I write my own effect base class?
2. If AudioProcessors make sense, should I connect these up with the AudioProcessorGraph?
3. Can I set an arbitrary number of in and outs on an AudioProcessor?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![holy-city](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@holy-city](https://forum.juce.com/u/holy-city)\
**Post date:** [October 2, 2017, 11:19pm UTC](https://forum.juce.com/t/question-about-audioprocessor/24475/2 "2017-10-02T23:19:00Z")

</div>

This sounds like a job for the DSP module, not the AudioProcessor class

---

<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:** [October 3, 2017, 11:40am UTC](https://forum.juce.com/t/question-about-audioprocessor/24475/3 "2017-10-03T11:40:28Z")

</div>

You could split up your effect into several AudioProcessors and then hook them up via the AudioProcessorGraph class but that seems a bit overkill to me. You probably only want to do that if you are actually hosting a third-party plug-in or if you want to rely on all the AudioProcessor features such as programs and parameters.

A slightly more lightweight approach would be to chain up several [`AudioSource`](https://www.juce.com/doc/classAudioSource)s. Each `AudioSource` can pull audio from the previous `AudioSource`. You can use the `MixerAudioSource` to mix everything together.

But depending on how many blocks you have I think I would try to keep it simple and simply compose your overall effect by calling different sub-routines which process some passed-in buffer.

---

<div class="post-metadata">

**Author:** ![cutlasses](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/cutlasses/32/2919_2.png) [@cutlasses](https://forum.juce.com/u/cutlasses)\
**Post date:** [October 3, 2017, 11:58am UTC](https://forum.juce.com/t/question-about-audioprocessor/24475/4 "2017-10-03T11:58:59Z")

</div>

@fabian Ok, thanks Fabian, yes, what I want to do is quite simple, which is why I wanted to check whether I was fighting against the intentions of the API, which it sounds like I was.

I assumed an AudioSource could only produce sound, but I guess there’s nothing to stop me connecting them internally in a bespoke child class. I think you might be right though, that it’s easier just to handle the (relatively simple) graph in non-JUCE specific code.

---

<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:** [October 3, 2017, 1:55pm UTC](https://forum.juce.com/t/question-about-audioprocessor/24475/5 "2017-10-03T13:55:57Z")

</div>

> [@cutlasses](#):
>
> I assumed an AudioSource could only produce sound, but I guess there’s nothing to stop me connecting them internally in a bespoke child class.

Look at [`ReverbAudioSource`](https://www.juce.com/doc/classReverbAudioSource) for example: it pulls it’s input from another audio source, but it’s also an AudioSource in itself, i.e. it’s a source for a reverbed version of the original source.
