0
0

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) 😀

[code:hyak811p]
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

End Function
[/code:hyak811p]

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:

[code:hyak811p]
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.
int Count;
short
Buffer;
Buffer=newbuffer;
for(Count=0; Count<=length; Count+=1)
{
// Switch left and right stereo
TempBufferL=(Buffer);
TempBufferR=
(Buffer+1);
*(Buffer++)=TempBufferR;
*(Buffer++)=TempBufferL;
}
return 0;
}

[/code:hyak811p]

  • You must to post comments
0
0

What language is it written in?
Cause I have never seen the Raw keyword in VB6, and when I try to use it it doesn’t work in VB6, nor in VB.Net

  • You must to post comments
0
0

It is in [url=http://bcx.basicguru.com/:3bsz5va7]BCX[/url:3bsz5va7]

  • You must to post comments
0
0

yes, it is BCX, the raw “keyword” is used to create an unitialized
variable. Which VB can’t do (at least i think it cant)

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.