Post

Replies

Boosts

Views

Activity

Reply to Saving non-parameter based presets in AUv3 extensions
This is an old post but maybe someone is still looking for a solution. I found that you can just override the fullStateForDocument property and just archive your settings using a Dictionary. No need to play with parameter trees if you don't need your settings to be modified by the Host. // Save an NSString named setting. - (NSDictionary<NSString *,id> *)fullStateForDocument {     NSMutableDictionary *state = [[NSMutableDictionary alloc] initWithDictionary: super.fullStateForDocument];     NSDictionary<NSString*, id> *settingsToSave = @{@"setting": setting,};     state[@"savedSettings"] = [NSKeyedArchiver archivedDataWithRootObject:settingsToSave requiringSecureCoding:NO error:nil];     return state; } // Retrieve settings - (void)setFullStateForDocument:(NSDictionary<NSString *,id> *)fullStateForDocument {     NSData *data = (NSData *)fullStateForDocument[@"savedSettings"];     NSDictionary *savedSettings = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDictionary class] fromData:data error:nil];     setting = (NSString *)savedSettings[@"setting"]; }
Aug ’22
Reply to Interface Builder doesn't honor Safe Area proportional alignment constraints
@Claude31, thanks for taking the time to comment and come up with a workaround. In my example, both buttons are children of the default view of a view controller. This view is the Superview for both buttons, and the Safe Area is the one defined for that view. In my example I expected to see a result like you got in your second screen shot. It seems like you have come up with a workaround for this issue by creating an extra view that matches the Safe Area and placing the button there. I think there is a problem in Interface Builder. Height and width constraints with respect to the Safe Area (without a need for an extra view) work (I have tested those and they work), but horizontal and vertical alignment constraints don't. I guess I will have to implement your workaround. It is very unfortunate that something as simple as this doesn't work correctly.
Mar ’22
Reply to Access to host MIDIOutputEventBlock in allocateRenderResources method of AUv3 app
My first entry on this question has a lot of errors and misconceptions but I can't edit it anymore. First, the MIDIOutputEventBlock is a property of the Audio Unit plug-in. According to the header on this property: "The host can set this block and the plug-in can call it in its renderBlock to provide to the host the MIDI data associated with the current render cycle." Second, in the example code that I referenced, the class that calls the allocateRenderResourcesAndReturnError and the internalRenderBlock methods is the actual AudioUnit class. In the template currently being generated by Xcode, these methods are part of the xxxDSPKernelAdapter so, of course, using self will generate a compile error. Any insight anybody could provide on how to obtain and then cache the MIDIOutputEventBlock property, would be greatly appreciated.
Jan ’21
Reply to Audio from a file generated from an AVAudioEngine bus tap has different speed than the one played on device output
To complement the answer above, the sample rate can vary depending on the device, or the audio output (speakers, headphones, bluetooth, etc). It is necessary to determine the sample rate, by looking into the sample rate of the audio session: let audioSession = AVAudioSession.sharedInstance() let sampleRate = audioSession.sampleRate let audioFormat = AVAudioFormat(standardFormatWithSampleRate: sampleRate, channels: 2)
Aug ’20
Reply to Audio from a file generated from an AVAudioEngine bus tap has different speed than the one played on device output
I printed out the AVAudioPCMBuffer format and for some undocumented reason (not the first time, this seems to be a recurring theme with Apple's APIs) the sample rate defaults to 48000Hz. This is what is causing the speed discrepancy. Changing the following line of code, fixes the issue:let audioFormat = AVAudioFormat(standardFormatWithSampleRate:48000, channels: 2)
Mar ’20
Reply to Watch and iPhone Simulator diagnosticd hogging CPU and Memory
I know this is an old question but I was running into the same problem where the diagnosticd and the ReportCrash processes started to consume high percentages of CPU and the fans would start spinning. After trying many things I found that the only thing that worked was to go to the simulator "Hardware" menu and select "Erase All Content and Settings...". Then quit the simulator and start it again. After that, the problem goes away. Hope this helps anybody searching for a fix for this issue which is still happening in XCode 11.2.1 running on Mojave 10.14.6.
Jan ’20
Reply to Xcode 10.0 diagnosticd high CPU w/iPhone XR Simulator
I know this is an old question but I was running into the same problem where the diagnosticd and the ReportCrash processes started to consume high percentages of CPU and the fans would start. After trying many things I found that the only thing that worked was to go to the simulator "Hardware" menu and select "Erase All Content and Settings...". Then quit the simulator and start it again. After that, the problem goes away. Hope this helps anybody searching for a fix for this issue which still is happening in XCode 11.2.1 running on Mojave 10.14.6.
Jan ’20