Skip to content

Commit

Permalink
Issue #38: MIKMIDIEndpointSynthesizer now sets reverb to -120 if it's…
Browse files Browse the repository at this point in the history
… using the DLSSynth (on OS X).
  • Loading branch information
armadsen committed Feb 16, 2015
1 parent 47aa894 commit 345ddee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 10 additions & 1 deletion Source/MIKMIDIEndpointSynthesizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (instancetype)initWithMIDISource:(MIKMIDISourceEndpoint *)source
}

- (instancetype)initWithMIDISource:(MIKMIDISourceEndpoint *)source componentDescription:(AudioComponentDescription)componentDescription;
{
{
self = [super init];
if (self) {
if (source) {
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions Source/MIKMIDIMetronome.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 345ddee

Please sign in to comment.