Hey guys, i’ve been fiddling with DSP and i made something.
Of course you all have probably done it before. (i just got so excited
I had to share it) 😀
Global TempBufferL As Short
Global TempBufferR As Short
Function Modify(originalbuffer As VOID Ptr, newbuffer As VOID Ptr, length As Integer) As Integer
‘This is not a dsp function callback, this is a dsp plugin for XMP5
‘This code can go directly in a dsp function callback.
Dim Raw Count As Integer
Dim Raw Buffer As Short*
Buffer = newbuffer For Count = 0 To length 'Switch left and right stereo TempBufferL = *(Buffer) 'Store left buffer in temp, buffer TempBufferR = *(Buffer+1) 'Store right buffer in temp, buffer +1 *(Buffer++) = TempBufferR 'set the left channel to the right channel, buffer = buffer +1 *(Buffer++) = TempBufferL 'Right = left, buffer = buffer +1 Next Count Function = 0 'Return newbuffer in a dsp function callback
This code is for a 16bit stereo mixer. (i don’t know how to do it for
32bit float). Let me know what you think, and any suggestions you have.
Here is the code in C:
static short TempBufferL;
static short TempBufferR;
int Modify (void originalbuffer, void *newbuffer, int length)
// This is not a dsp function callback, this is a dsp plugin for XMP5
// This code can go directly in a dsp function callback.
for(Count=0; Count<=length; Count+=1)
// Switch left and right stereo
- nci asked 13 years ago
Please login first to submit.