procedure Rotate(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD); stdcall;
var a: DWORD; d: PSingle;
begin
d := buffer;
a := 0;
while (a < (length div 4)) do
begin
d^ := d^ * Abs(Sin(rotpos));
Inc(d);
d^ := d^ * Abs(Cos(rotpos));
rotpos := fmod(rotpos + REFECT/100000, Pi); //REFECT:=sTrackBar1.Position - Им регулируешь.
Inc(d);
a := a + 2;
end;
end;
procedure Flange(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD); stdcall;
var
a: DWORD;
d: PSingle;
f, s: Single;
p1, p2: Integer;
begin
d := buffer;
a := 0;
while (a < (length div 4)) do
begin
p1 := Trunc(flapos + flas) mod FLABUFLEN;
p2 := (p1 + 1) mod FLABUFLEN;
f := fmod(flas, 1);
s := d^ + ((flabuf[p1, 0] * (1 - f)) + (flabuf[p2, 0] * f));
flabuf[flapos, 0] := d^;
d^ := s;
Inc(d);
s := d^ + ((flabuf[p1, 1] * (1 - f)) + (flabuf[p2, 1] * f));
flabuf[flapos, 1] := d^;
d^ := s;
flapos := flapos + 1;
if (flapos = FLABUFLEN) then
flapos := 0;
flas := flas + flasinc;
if (flas < 0.0) or (flas > FLABUFLEN) then
flasinc := -flasinc;
Inc(d);
a := a + 2;
end;
end;
...
procedure TForm1.Eff2(Sender: TObject; chan: DWORD);
begin
//if (Action12.Checked) then
//begin
rotpos := 0.7853981;
rotdsp := BASS_ChannelSetDSP(chan, @Rotate, 0, 2);
//end
//else
//BASS_ChannelRemoveDSP(chan, rotdsp);
end;
procedure TForm1.Eff3(Sender: TObject; chan: DWORD);
begin
//if Action14.Checked=true then
//begin
FillChar(flabuf, SizeOf(flabuf), 0);
flapos := 0;
flas := FLABUFLEN / 2;
flasinc :=sTrackBar2.Position/1000; //<-Трек баром регулируешь
fladsp := BASS_ChannelSetDSP(chan, @Flange, 0, 0);
//end
//else
//BASS_ChannelRemoveDSP(chan, fladsp);
end;