# JUCE 4 to JUCE 5 having strange issues with standalone plugin

**URL:** <https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701>\
**Category:** Audio Plugins\
**Created:** [December 22, 2017, 4:21am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701 "2017-12-22T04:21:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elan\_Hickler](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@Elan\_Hickler](https://forum.juce.com/u/Elan_Hickler)\
**Post date:** [December 22, 2017, 4:21am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/1 "2017-12-22T04:21:20Z")

</div>

Upgraded from JUCE 4 code to 5 and some very strange things are occurring.

What happened to the audio settings?

JUCE 4:  
 ![](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/e/ea27c3530405527a2addf952c42576fe8d569c2f.png)

JUCE 5:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/e/e193f1420185e542634582c49ac9d640a9ba8061.png)

And why am I hitting this assert? (And consequently standalone plugin remains silent)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/8/8f87c97629fb0dcb0d80e35d0c8bd1f40e355f77.png)

Edit: I realize there’s a description of why it’s being hit, no idea where to call reset, and why it’s suddenly needed.

---

<div class="post-metadata">

**Author:** ![noahdayan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/noahdayan/32/4093_2.png) [@noahdayan](https://forum.juce.com/u/noahdayan)\
**Post date:** [December 22, 2017, 9:12am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/2 "2017-12-22T09:12:21Z")

</div>

In the `AudioDeviceSelectorComponent` constructor, you can specify whether certain fields are visible or hidden as explained here: [https://juce.com/doc/classAudioDeviceSelectorComponent#a859af6ef664a974dc7d2ce3d24d8f94c](https://juce.com/doc/classAudioDeviceSelectorComponent#a859af6ef664a974dc7d2ce3d24d8f94c)

As for the assertion, you need to call `reset()` in the `prepareToPlay()` function of your `AudioProcessor` on your `MidiMessageCollector` like so:

`midiCollector.reset (sampleRate);`

---

<div class="post-metadata">

**Author:** ![Elan\_Hickler](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@Elan\_Hickler](https://forum.juce.com/u/Elan_Hickler)\
**Post date:** [December 22, 2017, 9:45am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/3 "2017-12-22T09:45:58Z")

</div>

thanks!

---

<div class="post-metadata">

**Author:** ![Elan\_Hickler](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@Elan\_Hickler](https://forum.juce.com/u/Elan_Hickler)\
**Post date:** [December 22, 2017, 6:04pm UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/4 "2017-12-22T18:04:25Z")

</div>

How do you customize it without editing the JUCE code?

i.e. create a sub class, override, etc. where do you do it? ~~what do you override?~~ etc.

I can probably figure out what to override, but I just have no f\*\*\*ing clue how JUCE expects me to not edit the JUCE code.

---

<div class="post-metadata">

**Author:** ![Elan\_Hickler](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@Elan\_Hickler](https://forum.juce.com/u/Elan_Hickler)\
**Post date:** [December 22, 2017, 7:07pm UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/5 "2017-12-22T19:07:52Z")

</div>

There’s no MidiMessageCollector declared in class AudioProcessor…? So this seems to be invalid:

> As for the assertion, you need to call reset() in the prepareToPlay() function of your AudioProcessor on your MidiMessageCollector like so:
> 
> `midiCollector.reset (sampleRate);`

not sure why this is so difficult for me… wish there was a guide on customizing standalone app.

---

<div class="post-metadata">

**Author:** ![noahdayan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/noahdayan/32/4093_2.png) [@noahdayan](https://forum.juce.com/u/noahdayan)\
**Post date:** [January 3, 2018, 9:33am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/6 "2018-01-03T09:33:04Z")

</div>

Have you tried creating a new standalone plugin from the Projucer plugin template? Do you see the same errors?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [January 3, 2018, 10:40am UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/7 "2018-01-03T10:40:40Z")

</div>

As a reference have also a look in this thread:

> [@Styling the Standalone plugin window?](https://forum.juce.com/t/styling-the-standalone-plugin-window/21872/15):
>
> There are two approaches here that you could do: you use the standalone app that JUCE already provides for you. Then you don’t need any macros etc. This is the approach that JUCE’s audio plugin demo uses. If you want different behaviour in your standalone app (compared to your plug-in), you can use: PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType\_Standalone For example, you could use this in a parentHierarchyChanged callback in your plug-ins editor to change the window st…

---

<div class="post-metadata">

**Author:** ![Elan\_Hickler](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@Elan\_Hickler](https://forum.juce.com/u/Elan_Hickler)\
**Post date:** [January 3, 2018, 4:41pm UTC](https://forum.juce.com/t/juce-4-to-juce-5-having-strange-issues-with-standalone-plugin/25701/8 "2018-01-03T16:41:05Z")

</div>

Thanks! I have this figured out as much as I care to at the moment, will take a look again in the future.
