surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.11k stars 397 forks source link

surge-au: plugin.h file not found (called by aulayer.h) #34

Closed esaruoho closed 5 years ago

esaruoho commented 5 years ago

while attempting to compile with Xcode 10.1, I get this:

funknown_h

seems like a plugin.h is called by aulayer.h. i'm not sure where to get that file from. any ideas? @JurekR ?

Jurek-Raben commented 5 years ago

xcode 10.1 is macos 10.14, right? Still on macos 10.13.4 (10.13.6 contains some nasty intel cpu spectre v3(?) firmware with max. 8% speed decrease, AFAIK Apple flashes it to the cpu, while Windows soft-loads it). Sorry, no idea.

esaruoho commented 5 years ago

Well, more like wondering how to create or find the plugin.h :)

Jurek-Raben commented 5 years ago

Are the audiounit headers installed along with xcode installation, or do you have to install it separately? What about trying to build vst2 only first?

esaruoho commented 5 years ago

@JurekR well with the "build vst2 only first" issue, i'm getting 128 errors. of which 108 are warnings and 20 are actual bonafide errors.

here are a couple:

caviewlayer_mm
esaruoho commented 5 years ago
caviewlayer_mm
esaruoho commented 5 years ago
caviewlayer_mm
esaruoho commented 5 years ago

and so on.

Jurek-Raben commented 5 years ago

Uh, I dunno, will try in some days, ask in the kvr thread maybe.

esaruoho commented 5 years ago

thread seems to be at https://www.kvraudio.com/forum/viewtopic.php?f=1&t=511922

baconpaul commented 5 years ago

Oh hey sorry IU didn’t see this issue. i put some comments in issue #49 which solves those objc errors and gets to a linked vst on a Mac.

baconpaul commented 5 years ago

So a bit more digging. It looks like there's a couple of AU problems.

1: Some files just aren't in GitHub. I think plugin.h is a name of an older file which also defines the (now gone but referenced) symbol sub3_synth which is referenced all over the au cpp code but commented out elsewhere. I'm forking a theory that in some older version - the last one where au built on mac - the core class was named sub3_synth and somewhere there was a file called plugin.h which had inside it something that looked like "class plugin { }" and "class sub3_synth { }".

2: if you do create a plugin.h stub your next two problems will be MusicDeviceBase.h and storage.h. storage.h is pretty easy. That's been renamed to "SurgeStorage.h" so changing that include fixes it. MusicDeviceBase.h, though, is part of an older AU version 2 API which is no longer on mojave

Some other things which plugin.h or MusicDeviceBase seemed to do were

1: Include <CoreFoundation/CoreFoundation.h> so all those CFSTRs can work 2: define CmoponentResult (as an OSStatus) and the stream (which has been renamed)

I don't know if I'll get anywhere but I am hacking away at it. If you want to see what I'm up to, I have a "au-build" branch on GitHub in my fork of surge.

baconpaul commented 5 years ago

Hey yeah look at this I just found in SurgeSynthesizer.cpp. I'm now convinced that sub3_synth is the old name of SurgeSynthesizer and the AU code just didn't get ported across ever. I'll keep noodling. Hope you don't mind me leaving my breadcrumbs in this issue.

/*unsigned int sub3_synth::getParameterFlags (long index)
{
        if (index<storage.getPatch().param_ptr.size())
        {
                return storage.getPatch().param_ptr[index]->ctrlstyle;
        }
        return 0;
}*/

float SurgeSynthesizer::getParameter(long index)
{
   if (index < 0)
      return 0.f;
   if (index >= metaparam_offset)
      return storage.getPatch()
          .scene[0]
          .modsources[ms_ctrl1 + index - metaparam_offset]
          ->get_output();
   if (index < storage.getPatch().param_ptr.size())
      return storage.getPatch().param_ptr[index]->get_value_f01();
   return 0.f;
}
baconpaul commented 5 years ago

Last comment for the morning I think. It is definitely the case that doing the work to replaces sub3_synth and plugin with SurgeSynthesizer then doing all the all_notes_off -> allNotesOff conversion gets me really far in building the AU. Again https://github.com/baconpaul/surge/tree/au-build shows you my latest but absolutely nothing there ready for a PR or any such.

I think we should probably start a separate issue for the AU base class stuff and leave this issue to be the plugin -> SurgeSynthesizer stuff. But I'm new here and just doing some weekend hacking so I'll leave that up to you all!

Thanks

esaruoho commented 5 years ago

@baconpaul i don't mind the breadcrumbs at all! thanks heaps for thinking and looking at this in such great detail. If I can figure out how to isolate some of it into simple PRs then that's great, but whichever form this takes, I'm glad you're giving a look at it. I hope if you do a PR, @abique and @kurasu will take the time to look at it, and allow it to land so we can get a move on with this :)

baconpaul commented 5 years ago

Thanks. A path forward to an AUv3 is becoming clearer to me. I'm going to screw around for a bit in a protective branch-off-my-branch-off-my-fork and see where I can get.

AUV3 is very different than AUV2; and SurgeSynthesizer is rather different from sub3_synth. I think most of the code in src/au won't be part of Surge running in Logic 10.4 on Mojave... I just still don't quite know what source will be part of that :)

If I figure out anything useful I will start a fresh issue here.

baconpaul commented 5 years ago

59 fixes this so we can close it. Thanks!

esaruoho commented 5 years ago

closing, thanks @baconpaul !