Hi all !
I know that one is a far cry, but would anyone had already made a script that translate decimal numbers into HEX?
I'm experimenting with RFID tags...
thanks
Olivar
display in Hexadecimal !
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
How about this? Note that it will round your input down to an integer prior to the conversion to hex so you may lose some precision..
Code: Select all
//////////////////////////////////////////////////////
// Int to Hex
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////
var input : Tparameter;
var output: Tparameter;
//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin
input := CreateParam('input', ptDatafader);
SetIsOutput(input,false);
SetMin(input, 0);
SetMax(input, 2048);
SetSymbol(input,'');
SetDefaultValue(input,10);
SetValue(input,10);
output := CreateParam('output',ptTextField);
SetIsInput(output,false);
SetMin(output,0);
SetMax(output,100);
SetSymbol(output,'');
SetDefaultValue(output,10);
end;
// Global Variables
var inval : single;
//////////////////////////////////////////////////////
// Main Loop procedure
//////////////////////////////////////////////////////
Procedure Callback(N:integer);
begin
inval := getValue(input);
setstringvalue(output, IntToHex(Trunc(inval)));
end;Thanx 0xFFFF times !
Now I can display the RFID tag in HEX, just like on my phone !
Those RFID Tags will be used to change patches and preset in Hollyhock
Now I can display the RFID tag in HEX, just like on my phone !
Those RFID Tags will be used to change patches and preset in Hollyhock
Code: Select all
//////////////////////////
// Array values (INTEGERS) to HEX commaText
/////////////////////////
CONST MAX_ITEMS = 8;
var ArrayIn, CommaOUT: Tparameter;
var SL1: TstringList;
/////////////////////////////
procedure init;
var i: integer;
begin
SetModuleColor($808080+302060);
ArrayIn:= CreateParam('ArrayIn', PtArray);
SetIsOutput(ArrayIn,False); SetMin(ArrayIn,0); setMax(ArrayIn,MAXINT);
CommaOUT:= CreateParam('CommaOUT',PtTextField);
setisINPUT(commaOut,false);
SL1.create;
END;//INIT
///////////////////////////////////////////
Procedure Callback(N:integer);
var i, L: integer;
var s : string;
begin
if (n=ArrayIn)
then begin
SL1.Clear;
L:= getLength(ArrayIn);
if L< MAX_ITEMS
then begin
For i:= 0 to L-1
do begin
s := IntToHex(trunc(getDataArrayValue(ArrayIn,i)));
SL1.add(s);
end;
setStringValue(CommaOut,SL1.GetCommatext);
end;
end;
END;//CB
////////////////////////////////////////
Procedure Destroy;
begin
SL1.free;
end;
///////////////////////////////http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Who is online
Users browsing this forum: No registered users and 85 guests
