Help with Scripting MidiOutSysEx

Hi guys!
I’m trying to convert some text into Hex in my script, to use in MidiOutSysEx…
Can anybody help? :slight_smile:

TopString := 'TESTING';

for i := 1 to 7 do
        begin
            Part := Copy(TopString, i, 1);
            PartInteger := Ord(Part[1]);         

            PartHex := IntToHex(PartInteger, 2);
        
            TopTest[i] := PartHex;
        end;

This results in the below

TopTest[1] := 54;
TopTest[2] := 45;
TopTest[3] := 53;
TopTest[4] := 54;
TopTest[5] := 49;
TopTest[6] := 4E;
TopTest[7] := 47;

But I need this:

TopTest[1] := #$54;
TopTest[2] := #$45;
TopTest[3] := #$53;
TopTest[4] := #$54;
TopTest[5] := #$49;
TopTest[6] := #$4E;
TopTest[7] := #$47;

For context, this is my setup and MidiOutSysEx…

    Start := #$f0;
    Manufacturer := #$00+#$20+#$32;
    DeviceId := #$15;
    Unknown := #$4c;
    SysExChannel := inttostr(Channel);  
    Color := lookupColor(Color, InvertedTop, InvertedBottom);
MidiOutSysEx(1, Start + Manufacturer + DeviceId + Unknown + SysExChannel + Color + TopTest[1] + TopTest[2] + TopTest[3] + TopTest[4] + TopTest[5] + TopTest[6] + TopTest[7] + EndString);

Thanks!
Thomas :slight_smile: