I am working on using a pd patch to send MIDI sysex parameters to control a Kawai K1r synthesizer parameters. My current patch is working however I would like to make my code more "resusable",
My patch consists of a slider with an outlet to a int object that converts the slider value into a whole number, then out to a message object that contains the complete decimal code for the sysex message. I have a $1 at the position where the parameter value should change, so the int object value is inserted into the message string at that point. Then the message is sent out to the midout. I am able to use the slider in my PD patch to change the value of a parameter and see and hear the changes from the synthesizer. My patch currently has 1 slider.
I intend to set up sliders for many parameters, and would like to avoid copying the full sysex message for each slider. It would seem preferable to store the "header" of the sysex message as a constant or global variable and build the sysex string by concatenating 3 or 4 parts; the header, the parameter number, the parameter value and the end of message.
Below is an example message in decimal values:
240 64 0 16 0 3 15 0 $1 247
Reading this left to right, I only need to change the 7th and 9th values in the sysex string. How do I go about doing this in PD?