diff --git a/Examples/macOS/MIDI To Audio/Sources/MIKMIDIToAudioExporter.m b/Examples/macOS/MIDI To Audio/Sources/MIKMIDIToAudioExporter.m index 3a1a3672..09b77e4a 100644 --- a/Examples/macOS/MIDI To Audio/Sources/MIKMIDIToAudioExporter.m +++ b/Examples/macOS/MIDI To Audio/Sources/MIKMIDIToAudioExporter.m @@ -69,7 +69,7 @@ - (void)exportToAudioFileWithCompletionHandler:(MIKStudioMIDIToAudioExporterComp MIKMIDISequence *sequence = [MIKMIDISequence sequenceWithFileAtURL:self.midiFileURL error:&error]; if (!sequence) return [self finishWithError:error]; - self.synthesizer = [[MIKOfflineMIDISynthesizer alloc] init]; + self.synthesizer = [[MIKOfflineMIDISynthesizer alloc] initWithError:&error]; self.synthesizer.tracks = sequence.tracks; self.synthesizer.tempo = [sequence tempoAtTimeStamp:0]; diff --git a/Examples/macOS/MIDI To Audio/Sources/MIKOfflineMIDISynthesizer.m b/Examples/macOS/MIDI To Audio/Sources/MIKOfflineMIDISynthesizer.m index b06569d4..613928fd 100644 --- a/Examples/macOS/MIDI To Audio/Sources/MIKOfflineMIDISynthesizer.m +++ b/Examples/macOS/MIDI To Audio/Sources/MIKOfflineMIDISynthesizer.m @@ -104,7 +104,16 @@ - (instancetype)initWithAudioUnitDescription:(AudioComponentDescription)componen return self; } -- (BOOL)setupAUGraph +- (instancetype)initWithError:(NSError *__autoreleasing _Nullable *)error +{ + self = [super initWithError:error]; + if (self) { + _midiClock = [MIKMIDIClock clock]; + } + return self; +} + +- (BOOL)setupAUGraphWithError:(NSError **)error { AUGraph graph; OSStatus err = 0;