# Audio chain : am I right?

**URL:** <https://forum.juce.com/t/audio-chain-am-i-right/4908>\
**Category:** General JUCE discussion\
**Created:** [February 17, 2010, 5:28am UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908 "2010-02-17T05:28:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinaiz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dinaiz/32/182_2.png) [@dinaiz](https://forum.juce.com/u/dinaiz)\
**Post date:** [February 17, 2010, 5:28am UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/1 "2010-02-17T05:28:35Z")

</div>

Hi Jules and Jucers

It’s not really a question, but more like a confirmation. I just want to make sure I correctly understood how Audio stuff works in Juce.

Let’s say I want to implement an audio signal chain :  
[Midi Input]-\>[MIDI processor]-\>[Virtual instrument]-\>[Virtual Effect(s)]

I should

- create an AudioProcessorGraph instance
- populate it (with several instances of both AudioGraphIOProcessor and AudioProcessor)
- then create an AudioProcessorPlayer instance
- call AudioProcessorPlayer::setProcessor with my AudioProcessorGraph
- finally, call AudioDeviceManager::addAudioCallback with my AudioProcessorPlayer instance

Is this right ?

Now let’s assume I want the following chain :  
[Audio (from wave file)-\>[Virtual Effect(s)]

In this case, I should create a new class which inherits both AudioSourcePlayer and AudioProcessor (so it can be added to an AudioProcessorGraph , via it’s addNode method), to read the wave file. Right ?  
Or should I create a new class which inherits AudioGraphIOProcessor and which calls AudioSourcePlayer::audioDeviceIOCallback inside it’s processBlock method ?

Does what I say even make sense ??? 🙂

---

<div class="post-metadata">

**Author:** ![Assembler](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Assembler](https://forum.juce.com/u/Assembler)\
**Post date:** [February 17, 2010, 11:35am UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/2 "2010-02-17T11:35:02Z")

</div>

That first bit sounds right, and I used the code on this post \<[http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=3505](http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=3505)\> to wrap an AudioSource and put it into an AudioProcessorGraph.

I hope that helps…

---

<div class="post-metadata">

**Author:** ![dinaiz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dinaiz/32/182_2.png) [@dinaiz](https://forum.juce.com/u/dinaiz)\
**Post date:** [February 17, 2010, 11:39am UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/3 "2010-02-17T11:39:26Z")

</div>

[quote=“Assembler”]That first bit sounds right, and I used the code on this post \<[http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=3505](http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=3505)\> to wrap an AudioSource and put it into an AudioProcessorGraph.

I hope that helps…[/quote]  
So…the second bit is wrong ? 😃  
EDIT : Ok I had a look at the post you mentioned, all is clear now 😃

By the way mate, I think you and me are trying to do the same thing, by looking at your other posts , which I found very intersesting (especially the one about “Transport”)

---

<div class="post-metadata">

**Author:** ![Assembler](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Assembler](https://forum.juce.com/u/Assembler)\
**Post date:** [February 17, 2010, 1:00pm UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/4 "2010-02-17T13:00:39Z")

</div>

Oh God no. You’ve stolen my ideas. Time to wear a saucepan on my head so no more get stolen.

We might be trying to do exactly the same thing. I suppose in the long run I’d like to build something enormous, but for now, a little Hammerhead type sequencer with VST support is proving enough of a challenge.  
I hope you have a little bit more luck than me, as I am a little stuck at the moment with this transport business. I feel very much up the shallow end with all the other things being posted in the forum, in this new weird language with & and \* in funny places. I’m trying to get my head around all the required bits of the API so I can jam them together… at the moment, the closest I have to play/stop is changing the soundcard settings.

Share your findings! Good Luck!

---

<div class="post-metadata">

**Author:** ![dinaiz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dinaiz/32/182_2.png) [@dinaiz](https://forum.juce.com/u/dinaiz)\
**Post date:** [February 17, 2010, 3:09pm UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/5 "2010-02-17T15:09:39Z")

</div>

> [@Assembler](#):
>
> Oh God no. You’ve stolen my ideas. Time to wear a saucepan on my head so no more get stolen.

Oh man, it’s been a while “we” can read over saucepans, and aluminium hats, mouhahaha. Well, I think a lot of people doing music software are trying to make transport stuff 🙂

> [@](#):
>
> We might be trying to do exactly the same thing. I suppose in the long run I’d like to build something enormous, but for now, a little Hammerhead type sequencer with VST support is proving enough of a challenge.  
> I hope you have a little bit more luck than me, as I am a little stuck at the moment with this transport business.

I think it’s far from being simple, especially if you start thinking about the synchronization problems !

[quote]  
I feel very much up the shallow end with all the other things being posted in the forum, in this new weird language with & and \* in funny places. I’m trying to get my head around all the required bits of the API so I can jam them together… at the moment, the closest I have to play/stop is changing the soundcard settings.

Share your findings! Good Luck![/quote]

I already did a full reverse engineering of Juce Audio Classes to UML. I think it helps a lot to understand how the thing works. If you’re interested in the diagrams, PM me with your email and I’ll sed you the class diagrams as jpgs 😃

---

<div class="post-metadata">

**Author:** ![Assembler](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Assembler](https://forum.juce.com/u/Assembler)\
**Post date:** [February 17, 2010, 10:45pm UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/6 "2010-02-17T22:45:29Z")

</div>

Diniaz, I sent a you PM, thank you for your offer!

---

<div class="post-metadata">

**Author:** ![dinaiz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dinaiz/32/182_2.png) [@dinaiz](https://forum.juce.com/u/dinaiz)\
**Post date:** [February 18, 2010, 4:53am UTC](https://forum.juce.com/t/audio-chain-am-i-right/4908/7 "2010-02-18T04:53:58Z")

</div>

Done !
