Last active
December 5, 2019 08:28
-
-
Save jpenca/9605113 to your computer and use it in GitHub Desktop.
A4 Kill FX (using the elektron-ctl framework)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// grab the current kit: | |
[A4Request requestWithKeys:@[@"kit.x"] | |
completionHandler:^(NSDictionary *dict) { | |
// make a copy of the kit: | |
A4Kit *kitOriginal = dict[@"kit.x"]; | |
A4Kit *kitCopy = [A4Kit messageWithSysexData:kitOriginal.sysexData]; | |
// set FX params to non-sounding values: | |
[kitCopy setFxParamValue:A4PValFxMake16(A4PARAMS_FX_CHOR.FEEDBACK, 0x40, 0)]; | |
[kitCopy setFxParamValue:A4PValFxMake16(A4PARAMS_FX_DELAY.FEEDBACK, 0, 0)]; | |
[kitCopy setFxParamValue:A4PValFxMake16(A4PARAMS_FX_DELAY.OVERDRIVE, 0, 0)]; | |
[kitCopy setFxParamValue:A4PValFxMake16(A4PARAMS_FX_REVERB.DECAY, 0, 0)]; | |
// send the modified kit: | |
[kitCopy sendTemp]; | |
// wait 0.5 seconds, send the original kit: | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
[kitOriginal sendTemp]; | |
}); | |
} errorHandler:^(NSError *err) { | |
NSLog(@"crap: %@", err.description); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment