Author Topic: Bass_fx tempo and mixer channels with speaker matrix  (Read 23 times)

dbaxter

  • Posts: 52
Having trouble getting the right sequence of calls to allow tempo setting of a channel that is 1) Opened, 2) set to a mixer channel, and then 3) has a speaker matrix applied. I've tried adding CChan := BASS_FX_TempoCreate(cchan, BASS_FX_FREESOURCE); at the various stages and the channel always turns into 0.
Is it doable to use a matrix with Bass_fx, or am I just not doing it right?
Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 20767
Re: Bass_fx tempo and mixer channels with speaker matrix
« Reply #1 on: 21 May '18 - 17:21 »
What is the error code from the failed BASS_FX_TempoCreate call? Use BASS_ErrorGetCode to check that. It may be BASS_ERROR_DECODE, in which case, you need to set the BASS_STREAM_DECODE flag on the source channel.

dbaxter

  • Posts: 52
Re: Bass_fx tempo and mixer channels with speaker matrix
« Reply #2 on: 22 May '18 - 05:08 »
The error is indeed #38, but it appears whether or not BASS_STREAM_DECODE is in the call to  tempo_create.
Perhaps the sequence of building the stream would be helpful. The stream is started with:
        CChan := BASS_StreamCreateFile(FALSE, PChar(FileName), 0, 0, BASS_STREAM_DECODE or BASS_SAMPLE_FLOAT or BASS_STREAM_PRESCAN {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});
followed by:
        BASS_Mixer_StreamAddChannel(Cmixer, CChan, BASS_MIXER_MATRIX or BASS_STREAM_AUTOFREE or BASS_MIXER_BUFFER);
and then the speaker matrix is built:
  oops := BASS_Mixer_ChannelSetMatrix(cchan, matrix);     // apply the matrix
and then finally, the tempo added:
       Cmixer := BASS_FX_TempoCreate(Cmixer, BASS_FX_FREESOURCE or BASS_STREAM_AUTOFREE);   // add tempo control
With or without " or BASS_STREAM_DECODE" in the tempo call, the #38 error happens and Cmixer becomes 0.
Should I take the decode out of the streamcreatefile call? But then what does the mixer work on?
Thank you.