Dynamic composition of a SysEx message with variable content and length

No he is a German/Bavarian language learning French :wink:

2 Likes

da schau her :rofl: :rofl: :rofl: :rofl:

And i now the Marterpfahl!!!

Coudl you please post your current version of the Keylab testing gig file, such that I can add a timer delayed display in it?

1 Like

here you go…multisynth with piano(2).gig (210.1 KB)

This is just for testing purposes for now:

multisynth_with_piano_3.gig (213.1 KB)

My changes in your script are after the // new comments. 2 sec after the last MIDI control message is received, the display will be refreshed. You will probably have to adapt the delay. Let me know if it works.

nope it does not - later today ill make a little video - makes life easier.
i still believe it is possible,as i was looking at the script changes you made.
are you a beta tester?

Is your initial custom message displayed or not at all?
Did you increase the delay if the timer?
Could you please put a MIDI monitor widget on the MIDI in block connected to the instrument plugins and check if some MIDI messages are displayed when you act on the KeyLab controls ?

initial display message (startup GP load gig) works fine.
if i connect midi monitor to artirias input midi block it shows on the first pad i hit (program change) the programm change - and pitch wheel messages!! Probably thats on the output side and (here comes the marterpfahl) DELETES the midimonitor plugin/block!!!
i think i need a siesta…
ps did not change the delay i thought 2 secs is enough
sorry all bullshit…by switching,of course,i go to another rack where the is no midi monitor…

OK, for a start, please avoid controls sending Program Change messages. Does it work with knobs or faders sending CC or pitchwheel messages ? It should :thinking:

(please Marterpfahl mit groß M!:stuck_out_tongue_winking_eye:)

i ll try - let you know later
(notorious kleinschreiber here)

1 Like

the global song settings does not allow cc as it just recognises the cc but not the value (0-127) of the cc

I am not sure we are talking from the same thing. I just would like to know if the modified script works. It is supposed to detect any control messages (not sure about PC that’s why I asked you to first avoid this), and each time a control message is detected it restarts the timer, thus once you stop to send control messages, wait two seconds and the script should refresh the KeyLab display.

ok i changed the song parts recall from PC to notes, and it does it.
if i THEN send a PC it shows first the PC value on the display and then the rackspace name reappears correctly after 2 second (delay in the script) .therefore the delay works.
BUT the cc`s on manipulated faders and knobs (wich normally show values) do not appear on the display anymore.
b.t.w. thanks for your geduld

OK, so everything works for you, the display is properly refreshed with the Rackspace name, but the knobs sending CC messages are not displayed anymore, right?

This shouldn’t be related to what I modified in the script. Could you please comment out the script to verify that this behavior is not related to the script (to comment out, put /* on the first line of the script and */ on the last line. Then compile again to inhibit the script).

I am a very geduldig guy :wink:

mexican dinner now…tomorrow…

1 Like

:stuck_out_tongue::hot_pepper::taco::beer::yum:

like this?

/*var
KeyLab_mkII_49 : MidiOutBlock;
SysEx : SysexManager;
KeyLab_mkII_49_LCD_PRE : String;
KeyLab_mkII_49_LCD_SEP : String;
KeyLab_mkII_49_LCD_END : String;
ASCII_STRING : String;
ASCII_HEX_STRING : String array;

// new
KeyLab_mkII_49_in  : MidiInBlock
DISPLAY_TIMER      : Ramp
TIMER_MS_DELAY     : Integer

Initialization
ASCII_STRING = " !"#$%&’()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Y]^_`abcdefghijklmnopqrstuvwxyz{|}><";
ASCII_HEX_STRING = [β€œ20”,β€œ21”,β€œ22”,β€œ23”,β€œ24”,β€œ25”,β€œ26”,β€œ27”,β€œ28”,β€œ29”,β€œ2A”,β€œ2B”,β€œ2C”,β€œ2D”,β€œ2E”,β€œ2F”,β€œ30”,β€œ31”,β€œ32”,β€œ33”,β€œ34”,β€œ35”,β€œ36”,β€œ37”,β€œ38”,β€œ39”,β€œ3A”,β€œ3B”,β€œ3C”,β€œ3D”,β€œ3E”,β€œ3F”,β€œ40”,β€œ41”,β€œ42”,β€œ43”,β€œ44”,β€œ45”,β€œ46”,β€œ47”,β€œ48”,β€œ49”,β€œ4A”,β€œ4B”,β€œ4C”,β€œ4D”,β€œ4E”,β€œ4F”,β€œ50”,β€œ51”,β€œ52”,β€œ53”,β€œ54”,β€œ55”,β€œ56”,β€œ57”,β€œ58”,β€œ59”,β€œ5A”,β€œ5B”,β€œ5C”,β€œ5D”,β€œ5E”,β€œ5F”,β€œ60”,β€œ61”,β€œ62”,β€œ63”,β€œ64”,β€œ65”,β€œ66”,β€œ67”,β€œ68”,β€œ69”,β€œ6A”,β€œ6B”,β€œ6C”,β€œ6D”,β€œ6E”,β€œ6F”,β€œ70”,β€œ71”,β€œ72”,β€œ73”,β€œ74”,β€œ75”,β€œ76”,β€œ77”,β€œ78”,β€œ79”,β€œ7A”,β€œ7B”,β€œ7C”,β€œ7D”,β€œ7E”,β€œ7F”];
KeyLab_mkII_49_LCD_PRE = "# F0 00 20 6B 7F 42 04 00 60 01 ";
KeyLab_mkII_49_LCD_SEP = " 00 02 β€œ;
KeyLab_mkII_49_LCD_END = " 00 F7”;

//new
TIMER_MS_DELAY = 4000; // 2000ms = 2sec delay

SetGeneratorOneShot(DISPLAY_TIMER,True);
SetGeneratorLength(DISPLAY_TIMER,TIMER_MS_DELAY+500);
SetGeneratorCoarseness(DISPLAY_TIMER,TIMER_MS_DELAY);

End

Function StringToHexString(str : String) Returns String
var i : Integer
result = β€œβ€;

For i=0; i<Length(str) ; i=i+1 Do
result = result + ASCII_HEX_STRING[IndexOfSubstring(ASCII_STRING, CopySubstring(str,i,1), True)];
End
End

Function KeyLab_mkII_49_LCD(line0 : String, line1 : String)
If Length(line0) > 16
Then
line0 = CopySubstring(line0, 0, 16);
End
line0 = StringToHexString(line0);

If Length(line1) > 16
Then
    line1 = CopySubstring(line1, 0, 16);
End
line1 = StringToHexString(line1);


SM_CreateSysexFromString(SysEx, KeyLab_mkII_49_LCD_PRE + line0 + KeyLab_mkII_49_LCD_SEP + line1 + KeyLab_mkII_49_LCD_END); 
SM_SendMidiOut(SysEx, KeyLab_mkII_49);

End

On Activate
var s : String;
s = β€œRackspace:”;
KeyLab_mkII_49_LCD(s, GetRackspaceName());

// new
SetTimersRunning(true);

End

// new

// Catch note events before theyis catched by the MIDI event callbacks
On NoteEvent(m : NoteMessage) from KeyLab_mkII_49_in

KeyLab_mkII_49_in.SendNow(m);

End

On MidiEvent(msg : MidiMessage) from KeyLab_mkII_49_in

KeyLab_mkII_49_in.SendNow(msg);

// Comment the 2 following lines an GP won't crash anymore on closing or opening another script
EnableGenerator(DISPLAY_TIMER, False);    
EnableGenerator(DISPLAY_TIMER, True);

End

On TimePassing(time : integer, magnitude : double) from DISPLAY_TIMER

//KeyLab_mkII_49_LCD(s, GetRackspaceName());
Print("Display again!");

End*/

if i did it (see above) correctly it is no good - still no difference and the display is stuck to the first rackspace name selected (i change rackspace by recalling)

Oh sorry, I forgot to switch from the test code to the code which is working for you.

Please modify the code by removing the // before KeyLab_mkII_49_LCD…
And add it before Print…

ok it looks like this now, still no response from knobs and sliders…and the first rack name is not being displayed anymore
and i am learning!!! // is marking line as comment

/*var
KeyLab_mkII_49 : MidiOutBlock;
SysEx : SysexManager;
KeyLab_mkII_49_LCD_PRE : String;
KeyLab_mkII_49_LCD_SEP : String;
KeyLab_mkII_49_LCD_END : String;
ASCII_STRING : String;
ASCII_HEX_STRING : String array;

// new
KeyLab_mkII_49_in  : MidiInBlock
DISPLAY_TIMER      : Ramp
TIMER_MS_DELAY     : Integer

Initialization
ASCII_STRING = " !"#$%&’()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Y]^_`abcdefghijklmnopqrstuvwxyz{|}><";
ASCII_HEX_STRING = [β€œ20”,β€œ21”,β€œ22”,β€œ23”,β€œ24”,β€œ25”,β€œ26”,β€œ27”,β€œ28”,β€œ29”,β€œ2A”,β€œ2B”,β€œ2C”,β€œ2D”,β€œ2E”,β€œ2F”,β€œ30”,β€œ31”,β€œ32”,β€œ33”,β€œ34”,β€œ35”,β€œ36”,β€œ37”,β€œ38”,β€œ39”,β€œ3A”,β€œ3B”,β€œ3C”,β€œ3D”,β€œ3E”,β€œ3F”,β€œ40”,β€œ41”,β€œ42”,β€œ43”,β€œ44”,β€œ45”,β€œ46”,β€œ47”,β€œ48”,β€œ49”,β€œ4A”,β€œ4B”,β€œ4C”,β€œ4D”,β€œ4E”,β€œ4F”,β€œ50”,β€œ51”,β€œ52”,β€œ53”,β€œ54”,β€œ55”,β€œ56”,β€œ57”,β€œ58”,β€œ59”,β€œ5A”,β€œ5B”,β€œ5C”,β€œ5D”,β€œ5E”,β€œ5F”,β€œ60”,β€œ61”,β€œ62”,β€œ63”,β€œ64”,β€œ65”,β€œ66”,β€œ67”,β€œ68”,β€œ69”,β€œ6A”,β€œ6B”,β€œ6C”,β€œ6D”,β€œ6E”,β€œ6F”,β€œ70”,β€œ71”,β€œ72”,β€œ73”,β€œ74”,β€œ75”,β€œ76”,β€œ77”,β€œ78”,β€œ79”,β€œ7A”,β€œ7B”,β€œ7C”,β€œ7D”,β€œ7E”,β€œ7F”];
KeyLab_mkII_49_LCD_PRE = "# F0 00 20 6B 7F 42 04 00 60 01 ";
KeyLab_mkII_49_LCD_SEP = " 00 02 β€œ;
KeyLab_mkII_49_LCD_END = " 00 F7”;

//new
TIMER_MS_DELAY = 4000; // 2000ms = 2sec delay

SetGeneratorOneShot(DISPLAY_TIMER,True);
SetGeneratorLength(DISPLAY_TIMER,TIMER_MS_DELAY+500);
SetGeneratorCoarseness(DISPLAY_TIMER,TIMER_MS_DELAY);

End

Function StringToHexString(str : String) Returns String
var i : Integer
result = β€œβ€;

For i=0; i<Length(str) ; i=i+1 Do
result = result + ASCII_HEX_STRING[IndexOfSubstring(ASCII_STRING, CopySubstring(str,i,1), True)];
End
End

Function KeyLab_mkII_49_LCD(line0 : String, line1 : String)
If Length(line0) > 16
Then
line0 = CopySubstring(line0, 0, 16);
End
line0 = StringToHexString(line0);

If Length(line1) > 16
Then
    line1 = CopySubstring(line1, 0, 16);
End
line1 = StringToHexString(line1);


SM_CreateSysexFromString(SysEx, KeyLab_mkII_49_LCD_PRE + line0 + KeyLab_mkII_49_LCD_SEP + line1 + KeyLab_mkII_49_LCD_END); 
SM_SendMidiOut(SysEx, KeyLab_mkII_49);

End

On Activate
var s : String;
s = β€œRackspace:”;
KeyLab_mkII_49_LCD(s, GetRackspaceName());

// new
SetTimersRunning(true);

End

// new

// Catch note events before theyis catched by the MIDI event callbacks
On NoteEvent(m : NoteMessage) from KeyLab_mkII_49_in

KeyLab_mkII_49_in.SendNow(m);

End

On MidiEvent(msg : MidiMessage) from KeyLab_mkII_49_in

KeyLab_mkII_49_in.SendNow(msg);

// Comment the 2 following lines an GP won't crash anymore on closing or opening another script
EnableGenerator(DISPLAY_TIMER, False);    
EnableGenerator(DISPLAY_TIMER, True);

End

On TimePassing(time : integer, magnitude : double) from DISPLAY_TIMER

KeyLab_mkII_49_LCD(s, GetRackspaceName());
Print("Display again!");

End*/