AIMP Forum

AIMP for Windows => Вопросы / Questions => Topic started by: koelo on August 09, 2022, 01:14:39

Title: 3 Band EQ script modification help needed
Post by: koelo on August 09, 2022, 01:14:39
Since the number of eq bands is changed from 18 to 20, the script I use for my 3 band eq is not working properly anymore.
I don't know how to fix it...Could someone edit the script please?

(https://s1.hostingkartinok.com/uploads/images/2022/08/d0f7b03e759b253cb9a7add2367e89c5.jpg)

----------------------------------------------------------------------------------------------------------

LowLevelsScript.script:

procedure Execute(var State: Integer);
var
  EQ: TComponent;
  M, N: Integer;
begin                           
  M:= FindObject('MediumLevelsScript').Get('Position'); 
  EQ:= FindObject('prvEqualizer');
  EQ.Set('BandValue1', ((State-1500)/100));
  for N:= 2 to 9 do
  EQ.Set('BandValue' + IntToStr(N), ((State - 1500) * (1 + cos(pi * (N - 1) /9)) + (M - 1500) * (1 + cos(pi * (10 - N) /9)))/200); 
  EQ.Set('BandValue10', ((M-1500)/100));
end;

----------------------------------------------------------------------------------------------------------

MediumLevelsScript.script:

procedure Execute(var State: Integer);
var
  EQ: TComponent;
  L, H, N: Integer;
 
begin                           
  L:= FindObject('LowLevelsScript').Get('Position');
  H:= FindObject('HighLevelsScript').Get('Position');
  EQ:= FindObject('prvEqualizer');
  EQ.Set('BandValue1', ((L-1500)/100));
  for N:= 2 to 9 do
  EQ.Set('BandValue' + IntToStr(N), ((State - 1500) * (1 + cos(pi * (10 - N) / 9)) + (L - 1500) * (1 + cos(pi * (N - 1) / 9)))/200);
  EQ.Set('BandValue10', ((State-1500)/100));
  for N:= 1 to 8 do
  EQ.Set('BandValue' + IntToStr(N + 10), ((State - 1500) * (1 + cos(pi * N / 8)) + (H - 1500) * (1 + cos(pi * (N - 8)/ 8)))/200);
  end;

----------------------------------------------------------------------------------------------------------

HighLevelsScript.script:

procedure Execute(var State: Integer);
var
  EQ: TComponent;
  M, N: Integer;
begin                           
  M:= FindObject('MediumLevelsScript').Get('Position');   
  EQ:= FindObject('prvEqualizer');
  EQ.Set('BandValue10', ((M-1500)/100));
    for N:= 1 to 8 do
  EQ.Set('BandValue' + IntToStr(N + 10), ((State - 1500) * (1 + cos(pi * (8 - N) /8)) + (M - 1500) * (1 + cos(pi * N/8)))/200);
end;

----------------------------------------------------------------------------------------------------------

Title: Re: 3 Band EQ script modification help needed
Post by: CkopoxoD on August 09, 2022, 17:23:20
https://www.aimp.ru/forum/index.php?topic=54358.msg425236#msg425236 Like this?
Title: Re: 3 Band EQ script modification help needed
Post by: koelo on August 09, 2022, 18:33:29
https://www.aimp.ru/forum/index.php?topic=54358.msg425236#msg425236 Like this?

You saved me :D