0
0

First, let me say that FSOUND_NORMAL I have set to include FSOUND_LOOP_NORMAL.

Softsynth in VB .. I get a buzzing sound upon FSOUND_Sample_Upload with no change in ‘tambre’ if the call is placed before the loop. (I prefer the call inside the loop)

‘Hopefully’ this should be enough to give you an idea of my question.

SA.pvData = FSOUND_Sample_Alloc(FSOUND_FREE, SA.cElements, FSOUND_NORMAL, 44100, 100, 0, 1)
hChn = FSOUND_PlaySound(FSOUND_FREE, SA.pvData)

SaUB = UBound(SampAry) ‘SampAry declared as Integer
Do While Looping
FSOUND_Sample_Upload SA.pvData, VarPtr(SampAry(0)), FSOUND_NORMAL
For N = 0 To SaUB
SampAry(N) = 500 * (Rnd – 0.5) ‘quiet noise
Next N
DoEvents
Loop

  • You must to post comments
0
0

FSOUND_NORMAL = FSOUND_16BITS Or FSOUND_SIGNED Or FSOUND_MONO Or FSOUND_LOOP_NORMAL

  • You must to post comments
0
0

There is no ‘white noise’, but rather, like I say, a ‘sample buzz’, and I think what is happening is that VarPtr(SampAry(0)) is not returning a useful memory address.

  • You must to post comments
0
0

If anyone could post a working example of a real-time generated sine wave I could take it from there.

  • You must to post comments
0
0

‘irrespective’ of my ‘lack of regard for the play cursor’ “there is no ‘white noise’, but rather a ‘sample buzz’,” MEANING that the random data I am writing to SampAry is simply not making it to the play buffer.

  • You must to post comments
0
0

“I believe” this is what you are looking for.

UB = UBound(SampAry)
SrcPtr = VarPtr(SampAry(0))

Do While DoEvents
If PreviousPlayPos < Pos Then
CStop = Pos – 1
CalculateSignal SampAry, CStart, CStop
CStart = Pos
ElseIf PreviousPlayPos > Pos Then
CStop = UB
CalculateSignal SampAry, CStart, CStop
CStart = 0
End If
PreviousPlayPos = Pos
Pos = FSOUND_GetCurrentPosition(hChn)
FSOUND_Sample_Upload SA.pvData, SrcPtr, FSOUND_NORMAL
Loop

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.