Sry for the late response, I did not really get to work on this earlier.
I did some testing, here go the results (I think I found whats wrong with it):
(1) ScratchingCommand_Execute produces the right pitch, but when I pass a negative value as an argument (obj), it will not play backwards. This must be the main issue. Any ideas how to fix this? I do not really see through this piece of code, so any help is appreciated:
Private Sub ScratchingCommand_Execute(obj As Object)
Dim Samplingrate1 As Integer = CInt(obj) 'turn object into integer
If ((Samplingrate1 < 100) AndAlso (Samplingrate1 > -Limit)) Then
Bass.BASS_ChannelSetAttribute(MainModule.reversestream, BASSAttribute.BASS_ATTRIB_REVERSE_DIR, -1)
Bass.BASS_ChannelSlideAttribute(MainModule.forwardstream, BASSAttribute.BASS_ATTRIB_FREQ, CSng(-Samplingrate1), 100)
ElseIf ((Samplingrate1 > 100) AndAlso (Samplingrate1 < Limit)) Then
Bass.BASS_ChannelSetAttribute(MainModule.reversestream, BASSAttribute.BASS_ATTRIB_REVERSE_DIR, 1)
Bass.BASS_ChannelSlideAttribute(MainModule.forwardstream, BASSAttribute.BASS_ATTRIB_FREQ, CSng(Samplingrate1), 100)
Else
Bass.BASS_ChannelSetAttribute(MainModule.reversestream, BASSAttribute.BASS_ATTRIB_REVERSE_DIR, 1)
Bass.BASS_ChannelSlideAttribute(MainModule.forwardstream, BASSAttribute.BASS_ATTRIB_FREQ, CSng(0), 100)
End If
End Sub
(2) As a matter of fact, the calculated interval is different from the actual interval in between the calls. I logged this, and this was returned:
0measured time: (+)3208,7395
0actual interval: (+)100
1measured time: (+)631,2004
1actual interval: (+)600
2measured time: (+)1128,5063
2actual interval: (+)1100
3measured time: (+)1628,1082
3actual interval: (+)1600
4measured time: (+)2107,17
4actual interval: (+)2100
5measured time: (+)2621,6564
5actual interval: (+)2600
6measured time: (+)3112,9302
6actual interval: (+)3100
7measured time: (+)3626,2407
7actual interval: (+)3600
8measured time: (+)4118,6537
8actual interval: (+)4100
9measured time: (+)4614,8074
9actual interval: (+)4600
10measured time: (+)5123,1657
10actual interval: (+)5100
I don't know if this is negligible, I guess I'd have to fix issue no. (1) first to find out...