Some inconsistencies in SDK8 or vdj really convert buffers multiple times for every plugin ?
or really don't figure out how to use it ^^
//////////////////////////////////////////////////////////////////////////
// DSP plugin class
class IVdjPluginDsp8 : public IVdjPlugin8
{
...
buffer is pointing to float
**************************
virtual HRESULT VDJ_API OnProcessSamples(float *buffer, int nb)=0;
...
};
//////////////////////////////////////////////////////////////////////////
// Buffer plugin class
class IVdjPluginBufferDsp8 : public IVdjPlugin8
{
...
buffer must point to short, songPos is int
*******************************************
// NOTE: samples are stereo, so you need to process up to buffer[2*nb]
virtual short * VDJ_API OnGetSongBuffer(int songPos, int nb)=0;
************* songPos looks more as a pointer (value match buffer, not position) when function is call
// Call this to get the buffer at the specified position
HRESULT GetSongBuffer(int pos, int nb, short **buffer) {return cb->GetSongBuffer(pos, nb, buffer);}
...
int SongPos; // number of samples from beginning of song
...
};
class IVdjPluginPositionDsp8 : public IVdjPluginBufferDsp8
{
public:
buffer is unknown, can get it as pointing to short from IVdjPluginBufferDsp8, songPos is double
**************************************************************************************************
virtual HRESULT VDJ_API OnTransformPosition(double *songPos, double *videoPos)=0;
buffer must be a pointer to short, songPos is int
**************************************************************************************************
virtual short * VDJ_API OnGetSongBuffer(int songPos, int nb) override { return NULL; }
};
can't ProcessSamples from IVdjPluginPositionDsp8 : public IVdjPluginBufferDsp8
can't GetSongBuffer from IVdjPluginBufferDsp8
or really don't figure out how to use it ^^
//////////////////////////////////////////////////////////////////////////
// DSP plugin class
class IVdjPluginDsp8 : public IVdjPlugin8
{
...
buffer is pointing to float
**************************
virtual HRESULT VDJ_API OnProcessSamples(float *buffer, int nb)=0;
...
};
//////////////////////////////////////////////////////////////////////////
// Buffer plugin class
class IVdjPluginBufferDsp8 : public IVdjPlugin8
{
...
buffer must point to short, songPos is int
*******************************************
// NOTE: samples are stereo, so you need to process up to buffer[2*nb]
virtual short * VDJ_API OnGetSongBuffer(int songPos, int nb)=0;
************* songPos looks more as a pointer (value match buffer, not position) when function is call
// Call this to get the buffer at the specified position
HRESULT GetSongBuffer(int pos, int nb, short **buffer) {return cb->GetSongBuffer(pos, nb, buffer);}
...
int SongPos; // number of samples from beginning of song
...
};
class IVdjPluginPositionDsp8 : public IVdjPluginBufferDsp8
{
public:
buffer is unknown, can get it as pointing to short from IVdjPluginBufferDsp8, songPos is double
**************************************************************************************************
virtual HRESULT VDJ_API OnTransformPosition(double *songPos, double *videoPos)=0;
buffer must be a pointer to short, songPos is int
**************************************************************************************************
virtual short * VDJ_API OnGetSongBuffer(int songPos, int nb) override { return NULL; }
};
can't ProcessSamples from IVdjPluginPositionDsp8 : public IVdjPluginBufferDsp8
can't GetSongBuffer from IVdjPluginBufferDsp8
发表时间 Wed 22 Jul 20 @ 1:00 pm
A dsp plugin processes the live audio that is about to be mixed. It uses the OnProcessSamples callback to do that, and is indeed working on 32-bit float values.
A buffer plugin processes the original decoded audio as it is needed, before any processing is applied. It uses the OnGetSongBuffer callback to do that, and you can use GetSongBuffer to get the original audio at that (or different) positions to prepare the final buffer. It indeed works on 16-bit integer values.
A buffer plugin processes the original decoded audio as it is needed, before any processing is applied. It uses the OnGetSongBuffer callback to do that, and you can use GetSongBuffer to get the original audio at that (or different) positions to prepare the final buffer. It indeed works on 16-bit integer values.
发表时间 Wed 22 Jul 20 @ 2:03 pm
Ok, So that as IVdjPluginDsp8 and IVdjPluginPositionDsp8 / IVdjPluginBufferDsp8 are exclusive classes this exclude the simultaneous use of them both
How can a IVdjPluginDsp8 Get Song Samples other than the ones passed to buffer within OnProcessSamples ?
i.e. get access to get access to previous or future samples (far after buffer ones) ? (in any know format)
Is there a "big buffer of floats" for the whole converted song and a way to get it ?
Or get access to the (strangely) downsampled to 16 bit one or the real original one (16, 24, 32bit int/float) in a way to get these samples ?
(porting TexZK flangerHQ to SDK8 is not something so simple ^^, sdk6 was able to give an easy access to both buffers)
(downsampling 24bits or 32bit tracks to 16bit is not top)
How can a IVdjPluginDsp8 Get Song Samples other than the ones passed to buffer within OnProcessSamples ?
i.e. get access to get access to previous or future samples (far after buffer ones) ? (in any know format)
Is there a "big buffer of floats" for the whole converted song and a way to get it ?
Or get access to the (strangely) downsampled to 16 bit one or the real original one (16, 24, 32bit int/float) in a way to get these samples ?
(porting TexZK flangerHQ to SDK8 is not something so simple ^^, sdk6 was able to give an easy access to both buffers)
(downsampling 24bits or 32bit tracks to 16bit is not top)
发表时间 Wed 22 Jul 20 @ 5:32 pm
You can use GetSongBuffer() or a circular buffer.
发表时间 Wed 22 Jul 20 @ 8:18 pm
AH YES cb->GetSongBuffer() is exactly what is needed
发表时间 Wed 22 Jul 20 @ 10:54 pm
Unless you just want to use it for some analysis it will be quite hard to properly incorporate the audio from GetSongBuffer into a dsp plugin. You not only have to do the conversion from short to float but also pitch, mastertempo and key.
For echo/flanger etc you typically keep a small circular buffer yourself from the dsp output directly.
For echo/flanger etc you typically keep a small circular buffer yourself from the dsp output directly.
发表时间 Thu 23 Jul 20 @ 5:07 am