0
0

Hello. I’ve got a function that sets the tempo of a channel that’s worked in a previous version of FMod (to be honest, I’m not sure [i:1iur86yp]which[/i:1iur86yp] version). I had to recently rewrite some things to accommodate some of the changes in the most recent version of FMod. Upon the rewriting, I’ve discovered that this function no longer worked:

[code:1iur86yp]’ ==================================================================
‘ Set tempo of channel.
‘ ==================================================================
Public Function setTempo(ByVal id As Long, ByVal tempo As Long) As Boolean

Dim err As Boolean
err = False

If (channel(id).effects(5) = 0) Then
    result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, channel(id).effects(5))
    If (isDebugging) Then
        err = errCheck(result, "setTempo-Util")
    End If
    result = FMOD_Channel_AddDSP(channel(id).id, channel(id).effects(5))
    If (isDebugging) And (Not err) Then
        err = errCheck(result, "setTempo-Util")
    End If
End If
Dim rTempo As Single
rTempo = CSng(tempo / 100)
result = FMOD_Channel_SetFrequency(channel(id).id, channel(id).freq * rTempo)
If (isDebugging) And (Not err) Then
    err = errCheck(result, "setTempo-Util")
End If
result = FMOD_DSP_SetParameter(channel(id).effects(5), FMOD_DSP_PITCHSHIFT_PITCH, 1 / rTempo)
If (isDebugging) And (Not err) Then
    Call errCheck(result, "setTempo-Util")
End If

setTempo = Not err

End Function[/code:1iur86yp]
The line ‘result = FMOD_DSP_SetParameter()’ seems to be the culprit. The odd thing is, the function isn’t continued after this line. For some reason, it’s being treated like the very last line of the function.
I have a closed channel system that I’ve subsequently made a custom data type for (it may look a bit odd to anyone who has a decent expereicne with FMod). As I’ve said, this function was working in a previous FMod version; is there something that I’m just not seeing here?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.