this line initializes the variable bar,
to be used on this code:
Image.SetSize("Image"..bar, 26, Tblsize[img_peakl]);
Image.SetSize("Image"..bar+5, 26, Tblsize[img_peakr]);
bar = bar + 1;
Note that the variable named BAR determines through concatenation, which image will have changed size!
In each of the repeat cycle timer, the image to be changed will be the next image, until activate this code:
if bar > 7 then
bar = 3;
end
This code is used to create the strings useds on Label LED Meter:
for x=1,26 do--witdh of one col audio bass-meter
pbar = pbar.."|";
Tblpeak[x] = pbar;
end
This code I could have done better. Instead of creating a table with 150 positions, I could have simply made an arithmetic operation within the timer.
Tblsize = {};
local sizebar = 150;--height of one col audio bass-meter
for x=1,150 do--same question
Tblsize[x] = sizebar;
sizebar = sizebar - 1;
end
The right would be this:
local img_peakl = 150 - (Math.Round((level.Left/32768)*150, 0));
local img_peakr = 150 - (Math.Round((level.Right/32768)*150, 0));
if img_peakl < 1 then
img_peakl = 1;
end
if img_peakr < 1 then
img_peakr = 1;
end
Image.SetSize("Image"..bar, 26, img_peakl);
Image.SetSize("Image"..bar+5, 26, img_peakr);
bar = bar + 1;
Without use the table Tblsize.