ListeningHelper is an audio player with speed changing function for macOS. It has the following functions:
- Music file playback
- Adjust Playback range
- Loop playback
- Speed(Rate) change
- Play pitch change
Without this we could not display the view with GarageBand.- (id)init {self = [super initWithNibName:@"AudioUnitViewController"bundle:[NSBundle bundleForClass:NSClassFromString(@"AudioUnitViewController")]];return self;}
Error loading {...snipped...}/SYVibratoFramework: dlopen({...
snipped...}/SYVibratoApp.app/Contents/Frameworks/SYVibratoFramework.framework/SYVibratoFramework, 265): Library not loaded: @rpath/SYFW.framework/Versions/A/SYFW
Referenced from: {...
snipped...}/SYVibratoApp.app/Contents/Frameworks/SYVibratoFramework.framework/SYVibratoFramework
Reason: image not foundPerhaps you can solve it without embedding if you can set @rpath.
254: Extension <private> advertises loadable bundle <private>, but we couldn't find itTo solve this error, I rechecked build settings, Info.plist, Sandbox related settings, etc...
To facilitate loading in-process and into a separate extension process, the .appx main binary cannot contain any code. Therefore, all the plugin functionality is contained in the FilterDemo.framework and the .appx Info.plist contains an AudioComponentBundle entry specifying the frameworks bundle identifier.In fact, FilterDemoExtension.m has only a function called dummy (), and all AU implementations seem to be thrust into FilterDemoFramework.framework.
xcsreciperunnerは、キーチェーンに含まれるキー"Xcode Server Root Certificate Authority"を使用して署名しようとしています。In English, this means "xcsreciperunner is trying to sign using the key "Xcode Server Root Certificate Authority" contained in the key chain."
Could not create client certificate authority: Error Domain=Security Code=-25293 "The user name or passphrase you entered is not correct." UserInfo={NSLocalizedDescription=The user name or passphrase you entered is not correct.}
2017-10-10 11:45:27.172 auvaltool[508:5335] Error: Session 091F49F0-C167-4CFB-820E-4DBCC049FD3B was unable to communicate with the remote service: Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 512 was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection from pid 512 was interrupted, but the message was sent over an additional proxy and therefore this proxy become invalid.}
- (void)embedPlugInView {
NSURL *builtInPlugInURL = [[NSBundle mainBundle] builtInPlugInsURL];
NSURL *pluginURL = [builtInPlugInURL URLByAppendingPathComponent: @"SYVibrato.appex"];
NSBundle *appExtensionBundle = [NSBundle bundleWithURL: pluginURL];
self.vibratoViewController = [[AudioUnitViewController alloc] initWithNibName:@"AudioUnitViewController" bundle:appExtensionBundle];
[self.vibratoProgressIndicator stopAnimation:self]; NSRect r = self.vibratoView.frame;
[self.vibratoViewController view].frame = NSMakeRect(0, 0, NSWidth(r), NSHeight(r)); [self.vibratoView addSubview:self.vibratoViewController.view];
[self.vibratoViewController connectAU:self.vibratoUnit.AUAudioUnit];}
After a struggle, I found the error could be removed by turning off Sandboxing of my containing app.Error Domain=NSOSStatusErrorDomain Code=-3000 "invalidComponentID"
As a result:- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {AudioComponentDescription desc;desc.componentType = 'aufx';desc.componentSubType = 'vbrt';desc.componentManufacturer = 'Symi';[AVAudioUnit instantiateWithComponentDescription:descoptions:0completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) {self.unit = audioUnit;AudioUnit unit = [audioUnit audioUnit];AUGenericView *view = [[AUGenericView alloc] initWithAudioUnit:unit];view.frame = self.window.contentView.frame;[self.window.contentView addSubview:view];}];}
I again ran the host app, thenAUParameter *freqParameter = [AUParameterTree createParameterWithIdentifier:VibratoParameterIdentifierFrequencyname:VibratoParameterNameFrequencyaddress:VibratoParameterAddressFrequencymin:0max:.01unit:kAudioUnitParameterUnit_HertzunitName:nilflags:kAudioUnitParameterFlag_IsReadable | kAudioUnitParameterFlag_IsWritablevalueStrings:nildependentParameters:nil];
By the way, in the code which was generated when we added AudioUnit App Extension,- (void) viewDidLoad {[super viewDidLoad];self.preferredContentSize = NSMakeSize(480, 272);}
However, because the audioUnit instance was always nil, the program immediately returns from viewDidLoad.- (void) viewDidLoad {[super viewDidLoad];if (!audioUnit) {return;}// Get the parameter tree and add observers for any parameters that the UI needs to keep in sync with the AudioUnit}
But, because viewDidLoad is called earlier than when createAudioUnitWithComponentDescription:error: is called, audioUnit property remains nil in viewDidLoad.- (AUAudioUnit *)createAudioUnitWithComponentDescription:(AudioComponentDescription)desc error:(NSError **)error {audioUnit = [[MyAudioUnit alloc] initWithComponentDescription:desc error:error];return audioUnit;}
A myParam1 is defined as// Create parameter objects.AUParameter *param1 = [AUParameterTree createParameterWithIdentifier:@"param1" name:@"Parameter 1" address:myParam1 min:0 max:100 unit:kAudioUnitParameterUnit_Percent unitName:nil flags:0 valueStrings:nil dependentParameters:nil];
In FilterDemo, the addresses are defined as enum as:// Define parameter addresses. (These needn't be static).#define myParam1 0
I think any unique values will be OK.enum {FilterParamCutoff = 0,FilterParamResonance = 1};
Then, I actually added parameters as:typedef NS_ENUM(AUParameterAddress, VibratoParameterAddress) {VibratoParameterAddressFrequency = 0,VibratoParameterAddressDepth = 1};
where, name and identifier strings were defined asAUParameter *freqParameter = [AUParameterTree createParameterWithIdentifier:VibratoParameterIdentifierFrequencyname:VibratoParameterNameFrequencyaddress:VibratoParameterAddressFrequencymin:0max:1unit:kAudioUnitParameterUnit_HertzunitName:nilflags:0valueStrings:nildependentParameters:nil];freqParameter.value = .0025;self.freq = freqParameter.value;AUParameter *depthParameter = [AUParameterTree createParameterWithIdentifier:VibratoParameterIdentifierDepthname:VibratoParameterNameDepthaddress:VibratoParameterAddressDepthmin:0max:250unit:kAudioUnitParameterUnit_SecondsunitName:nilflags:0valueStrings:nildependentParameters:nil];depthParameter.value = 250;self.depth = depthParameter.value;self.parameterTree = [AUParameterTree createTreeWithChildren:@[freqParameter, depthParameter]];
By the way, as for detecting the changes in these parameters from outside, FilterDemo's implementation isNSString *VibratoParameterIdentifierFrequency = @"VibratoParameterIdentifierFrequency";NSString *VibratoParameterIdentifierDepth = @"VibratoParameterIdentifierDepth";NSString *VibratoParameterNameFrequency = @"Frequency";NSString *VibratoParameterNameDepth = @"Depth";
I think this code means that blocks are executed when parameters were set/got.// implementorValueObserver is called when a parameter changes value._parameterTree.implementorValueObserver = ^(AUParameter *param, AUValue value) {filterKernel->setParameter(param.address, value);};// implementorValueProvider is called when the value needs to be refreshed._parameterTree.implementorValueProvider = ^(AUParameter *param) {return filterKernel->getParameter(param.address);};
By the way, it is noted that a block is needed to express these parameters as strings.MyAudioUnit *unit = self;self.parameterTree.implementorValueObserver = ^(AUParameter *param, AUValue value) {switch (param.address) {case VibratoParameterAddressFrequency:unit.freq = value;break;case VibratoParameterAddressDepth:unit.depth = value;default:break;}};self.parameterTree.implementorValueProvider = ^(AUParameter *param) {switch (param.address) {case VibratoParameterAddressFrequency:return unit.freq;case VibratoParameterAddressDepth:return unit.depth;default:break;}return 0.0f;};
So, I implemented as follows:// A function to provide string representations of parameter values._parameterTree.implementorStringFromValueCallback = ^(AUParameter *param, const AUValue *__nullable valuePtr) {AUValue value = valuePtr == nil ? param.value : *valuePtr;switch (param.address) {case FilterParamCutoff:return [NSString stringWithFormat:@"%.f", value];case FilterParamResonance:return [NSString stringWithFormat:@"%.2f", value];default:return @"?";}};
Finally, parameter setting will be completed.self.parameterTree.implementorStringFromValueCallback = ^(AUParameter *param, const AUValue *__nullable valuePtr) {AUValue value = valuePtr == nil ? param.value : *valuePtr;switch (param.address) {case VibratoParameterAddressFrequency:return [NSString stringWithFormat:@"%.f", value];case VibratoParameterAddressDepth:return [NSString stringWithFormat:@"%.0f", value];default:return @"?";}};