AudioProcessor & Synthsiser classes

Any recommendations on the best relationship between AudioProcessor and Synthesiser classes? Assume I am building a VST.

  1. MyPlugin is a subclass of AudioProcessor and owns a Synthesiser (and an AudioProcessorEditor).
  2. MyPlugin is a subclass of Synthesiser and owns an AudioProcessor (which AudioProcessor owns an AudioProcessorEditor).
  3. MyPlugin is a multiple inheritance subclass of both AudioProcessor and Synthsiser.
  4. ?

I’m guessing #1.

Bill

Yeah, I’d recommend #1

Wondering: If I take the DemoJuceFilter and set JucePlugin_IsSynth to 1, when compiling the example I get:

/Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h:119: error: cannot allocate an object of abstract type 'JuceAU' /Users/greenskin/Downloads/juce/extras/audio plugins/demo/build/AudioUnit/../../../wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp:67: note: because the following virtual functions are pure within 'JuceAU': /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h:76: note: virtual ComponentResult MusicDeviceBase::StartNote(MusicDeviceInstrumentID, MusicDeviceGroupID, NoteInstanceID*, UInt32, const MusicDeviceNoteParams&)

I presume I need extend from a certain class for the plugin to be a synth, but from which class is that? I tried subclassing from Synthesizer and adding the methods, but that didn’t do it.

Using XCode3 on 10.5.1 with Juce 1.45.

My xconfig:

MACOSX_DEPLOYMENT_TARGET_ppc = 10.3
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk

No, you’re doing it right, and that should just compile, but it looks like something must have changed in the new 10.5 SDK that breaks it.

I’m still using 10.4! This just sounds like a small tweak is needed in the AU code - presumably apple have just added a new virtual method that needs implementing… can any 10.5 people help out!?

Found it! Well, it compiles. I have not tested anything yet.

Line 456 in juce_AudioUnitWrapper.cpp was:

Should be:

Notice the pointer for NoteInstanceID. This is because in MusicDeviceBase.h the startnote method is:

/*! @method StartNote */ virtual ComponentResult StartNote( MusicDeviceInstrumentID inInstrument, MusicDeviceGroupID inGroupID, NoteInstanceID * outNoteInstanceID, UInt32 inOffsetSampleFrame, const MusicDeviceNoteParams &inParams) = 0;

Perhaps this has changed from 10.4 to 10.5?

ah right, thanks. Looks like they changed that parameter in 10.5.

I’ll guess I’ll have to put in both versions so it works in either one…