Hello I got this trackbar controling my pitch value;
private void trackBarTransp2_Scroll(object sender, EventArgs e)
{
_trackBarPitch = trackBarTranspose.Value; // define pitch value
if (_trackBarPitch == 0)
{
Bass.BASS_FXReset(_streamPitch); // This reset Is not working !!
labelTranspose.Text = "Transpose: " + trackBarTranspose.Value.ToString();
labelTranspose.ForeColor = Color.Black;
}
else
{
labelTranspose.Text = "Transpose: " + trackBarTranspose.Value.ToString();
labelTranspose.ForeColor = Color.Red;
pitchShift(_trackBarPitch);
}
}
My pitch funtion:
_stream = Bass.BASS_StreamCreateFile(_musicFile, 0L, 0L, BASSFlag.BASS_STREAM_DECODE);
_streamPitch = Bass.BASS_ChannelSetFX(_stream, BASSFXType.BASS_FX_BFX_PITCHSHIFT, 0);
BASS_BFX_PITCHSHIFT parametros = new BASS_BFX_PITCHSHIFT();
Bass.BASS_FXGetParameters(_streamPitch, parametros);
parametros.fPitchShift = _pitchArrayValue; //this is ZERO
parametros.fSemitones = _pitch; //(0 won't change the pitch). Default = 0.)
Bass.BASS_FXSetParameters(_streamPitch, parametros);
The problem is:
Everytime I make trackbar on ZERO value the funtion wont reset, It makes strange pitch values.
It seams like i got crazy on pitch values.
Please a little help to reset pitch.
Thanks