I have an application that should also work as an AudioUnit plugin. In Xcode, I go to File > New > Target, select AudioUnit and make sure that the selected language is "Swift". In the generated code, though, I have that the actual code of the plugin is within "h", "m" Objective C Files:
#import "ChordezAuAudioUnit.h"
#import <AVFoundation/AVFoundation.h>
// Define parameter addresses.
const AudioUnitParameterID myParam1 = 0;
@interface ChordezAuAudioUnit ()
@property (nonatomic, readwrite) AUParameterTree *parameterTree;
@property AUAudioUnitBusArray *inputBusArray;
@property AUAudioUnitBusArray *outputBusArray;
@end
@implementation ChordezAuAudioUnit
@synthesize parameterTree = _parameterTree;
- (instancetype)initWithComponentDescription:(AudioComponentDescription)componentDescription
[...]
How do I develop the plugin in Swift? In this Github project, the author seems to be doing it, but I don't know how to replace the generated code with the Swift one: https://github.com/inquisitiveSoft/MIDIAudioUnitExample/blob/main/TransposeOctaveAudioUnit/MIDIAudioUnit/MIDIAudioUnit.swift