Skip to content

Instantly share code, notes, and snippets.

@jpenca
Last active December 5, 2019 08:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpenca/9605113 to your computer and use it in GitHub Desktop.
Save jpenca/9605113 to your computer and use it in GitHub Desktop.
A4 Kill FX (using the elektron-ctl framework)
// 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