-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note Off command not working #291
Comments
Hi @pnome,
- (IBAction)sendNote:(id)sender//testing
{
NSError *error = nil;
self.synthesizer = [[MIKMIDISynthesizer alloc] initWithError:&error];
if (!self.synthesizer) {
NSLog(@"Error creating synthesizer: %@", error);
}
NSDate *date = [NSDate date];
MIKMIDINoteOnCommand *noteOn = [MIKMIDINoteOnCommand noteOnCommandWithNote:60 velocity:127 channel:0 timestamp:date];
MIKMIDINoteOffCommand *noteOff = [MIKMIDINoteOffCommand noteOffCommandWithNote:60 velocity:0 channel:0 timestamp:[date dateByAddingTimeInterval:2.0]];
[self.synthesizer handleMIDIMessages:@[noteOn, noteOff]];
} |
Hi @armadsen , I tried that, and I'm experiencing the same problem. I tested by adding a second note to play at When I run the code, both notes play immediately, and never turn off. As if all supplied midi notes are being handled immediately, rather than paying attention to the supplied timestamps. You can see it in action here: https://www.youtube.com/watch?v=Zzpm2neuBRA Any suggestions? |
Hi Joe, Interesting. I wrote the code I sent in a little test app that works fine. I didn't realize you were on iOS (I tested on macOS). It should work exactly the same, but perhaps there's an iOS-specific bug there. I'll dig a little more later this afternoon and will have more for you. |
Hi Andrew, |
Hi @armadsen, Best, |
I’m sure this is just something I’m not understanding, but I used the following code to try and play a note for 2 seconds. The note off command is never implemented.
I can add a third command for a different note on after 3 seconds, and I’ll end up hearing both. They just never turn off.
Can somebody help me understand what I’m doing wrong? Thanks!
`- (IBAction)sendNote:(id)sender//testing
{
}
`
The text was updated successfully, but these errors were encountered: