Bass

General discussion forum for Ams Plugin Maker
Post Reply
User avatar
milano88
Registered User
Posts: 2
Joined: Sun Jun 23, 2013 12:04 am

Bass

Post by milano88 »

hello reteset I need help for bass function

Code: Select all

HFX BASS_ChannelSetFX(
    DWORD handle,
    DWORD type,
    int priority
);

Code: Select all

typedef struct {
    float fCenter;
    float fBandwidth;
    float fGain;
} BASS_DX8_PARAMEQ;

Code: Select all

BOOL BASS_FXSetParameters(
    HFX handle,
    void *params
);
My code:

Code: Select all

BASS = {}

plPath = __Plugin.GetPath();
BassPath = plPath.."\\bass.dll";
ghBassDll= __DLL.LoadLibrary(BassPath,"stdcall");

BASS.Init = function (nFlags, nDevice, nFreq, nWin, nCLSID)
    local BASS_Init = __DLL.GetFunction(ghBassDll,_long,"BASS_Init",_long, _long, _long, _long, _long);
    if (BASS_Init ~= nil) then
        return BASS_Init(nFlags, nDevice, nFreq, nWin, nCLSID);
    end
end

BASS.StreamCreateFile = function (bMem, sFile, nOffset, nLength, nFlags)
    if (type(bMem) == "boolean") then
        if (bMem == true) then
            bMem = 1;
        else
            bMem = 0;
        end
    else
        bMem = 0;
    end
    local CreateFile = __DLL.GetFunction(ghBassDll,_long,"BASS_StreamCreateFile",_long, _string, _long, _long, _long);
    if (CreateFile ~= nil) then
	    return CreateFile(bMem, sFile, nOffset, nLength, nFlags);
    end
end

BASS.ChannelPlay = function (nHandle, bRestart)
    if (type(bRestart) == 'boolean') then
        if (bRestart == true) then
            bRestart = 1;
        else
            bRestart = 0;
        end
    end
    local ChannelPlay = __DLL.GetFunction(ghBassDll,_long,"BASS_ChannelPlay",_long, _long);
    if (ChannelPlay ~= nil) then
	return ChannelPlay(nHandle, bRestart);
    end
end

Code: Select all

BASS_ChannelSetFX = __DLL.GetFunction(ghBassDll,_int,"BASS_ChannelSetFX",_long, _long, _long);

Code: Select all

BASS_FXSetParameters = __DLL.GetFunction(BassLib,_long,"BASS_FXSetParameters",_long, _ptr);

Code: Select all

BASS_FXGetParameters = __DLL.GetFunction(BassLib,_long,"BASS_FXGetParameters",_long, _ptr);

Code: Select all

Bass.BASS_ChannelSetFX = function (nHandle, nType, nPriority)
    return BASS_ChannelSetFX(nHandle, nType, nPriority);
end

Code: Select all

Bass.BASS_FXSetParameters = function (nHandle, nParams)
    return BASS_FXSetParameters(nHandle, nParams);
end

Code: Select all

Bass.GetFXStruct = function()
eq = __Memory.CreateStruct(
_float,"fCenter",
_float,"fBandwidth",
_float,"fGain");
end

Code: Select all

function StartBASSFX(channel)
fx = {}
fx[1] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[2] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[3] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[4] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[5] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[6] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[7] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[8] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[9] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
fx[10] = Bass.BASS_ChannelSetFX(channel, BASS_FX_DX8_PARAMEQ, 1);
end

Code: Select all

eq.fGain = 15-e_Pos;
eq.fBandwidth = 3;
eq.fCenter = 80;
Bass.BASS_FXSetParameters(fx[1], eq);
example project in delphi

Code: Select all

http://www.cyberforum.ru/post3713799.html
thanks advance
Post Reply