diff --git a/Source/MIKMIDIEndpointSynthesizer.m b/Source/MIKMIDIEndpointSynthesizer.m index 429b4881..c104ea7b 100644 --- a/Source/MIKMIDIEndpointSynthesizer.m +++ b/Source/MIKMIDIEndpointSynthesizer.m @@ -43,7 +43,7 @@ - (instancetype)initWithMIDISource:(MIKMIDISourceEndpoint *)source } - (instancetype)initWithMIDISource:(MIKMIDISourceEndpoint *)source componentDescription:(AudioComponentDescription)componentDescription; -{ +{ self = [super init]; if (self) { if (source) { @@ -196,6 +196,15 @@ - (BOOL)setupAUGraph return NO; } +#if !TARGET_OS_IPHONE + // Turn down reverb which is way too high by default + if (instrumentcd.componentSubType == kAudioUnitSubType_DLSSynth) { + if ((err = AudioUnitSetParameter(instrumentUnit, kMusicDeviceParam_ReverbVolume, kAudioUnitScope_Global, 0, -120, 0))) { + NSLog(@"Unable to set reverb level to -120: %i", err); + } + } +#endif + if ((err = AUGraphStart(graph))) { NSLog(@"Unable to start AU graph: %i", err); return NO; diff --git a/Source/MIKMIDIMetronome.m b/Source/MIKMIDIMetronome.m index 48b4336f..11ef53cd 100644 --- a/Source/MIKMIDIMetronome.m +++ b/Source/MIKMIDIMetronome.m @@ -17,13 +17,6 @@ - (void)setupMetronome self.tickMessage = (MIDINoteMessage){ .channel = 0, .note = 57, .velocity = 127, .duration = 0.5, .releaseVelocity = 0 }; self.tockMessage = (MIDINoteMessage){ .channel = 0, .note = 56, .velocity = 127, .duration = 0.5, .releaseVelocity = 0 }; [self selectInstrument:[MIKMIDIEndpointSynthesizerInstrument instrumentWithID:7864376]]; - -#if !TARGET_OS_IPHONE - OSStatus err; - if ((err = AudioUnitSetParameter(self.instrument, kMusicDeviceParam_ReverbVolume, kAudioUnitScope_Global, 0, -120, 0))) { - NSLog(@"Unable to set reverb level to -120: %i", err); - } -#endif } - (instancetype)init