BASS_ChannelSetPosition, stream, lowpass

Started by MHTec (Guest),

MHTec (Guest)

Hello !
short overview what I need:
I coding an small 3dEngine in Delphi6. For the audio part I need a special way to play one sound on two different channels. I must set the playing sounds of the two channels on calculated samplepositions. Over these two channels I must set two different lowpass sets (simple lp with cutoff and resonance).

To play the sounds on two different channels and set the sampleposition on the calculated parameters is easy but the lowpass is the problem. I have tried to use the Bass_fxParameq but it is the wrong fx style - it must be an lp. Then I have tried to use the lowpass from the bass_fx1.1 but the lowpass doesn't worked. I think that this lp only works with streams and not with Bass_SamplePlayEx. So I used streams and  it worked good enough. But after I tried to set the streampositions the sound was horrible and the CPU speed goes down. No way to handle it so with my 3DEngine. HHHHMMM !
This is the problem:
SetSamplePos with SamplePlay works - no lowpass
Lowpass with StreamPlay works - bad SetStreamPos

Have anyone an idea to set an lowpass over an played sample ?
This is my favorite way but I haven't an idea to get the played samplebuffer. I have an lowpass IIR algo but I don't know how to manipulate this buffer with that lp algo.

Or
Have anyone an idea to set the streampos of two channels so fast in realtime that it gives no 'blob' and 'clack'-sounds ?

I hope anyone can help me. Thanx MHTec :O)

bigjim

Hi-
I seem a few delphi 3d engines and the results are superb but...

*) what exacly do you mean by calcualted sample positions- do you mean at a certain point in the sample file?

And could u consider using a stream as apose a sample-
tried using direct x fx for ur IIR filter?

Quick fix I have a dll at:

http://www.ingenious.demon.co.uk/eq.html

if any help

but really I cant see any reason why you cant use the direct x 8 fx.

reply/ :laugh:

MHTec

Hello bigjim ! Thanx for answering !!

yes
I will set a position point in the sample file that I played with Bass_SamplePlayEx.
For better understanding I have to Channels with the same sample they play simulan. One for the left channel (pan -100) and one for the right channel (pan 100). I have an 3D fx that is the audiosource. I am walking with my player around. At the walk around I am calculating the distance to that audiosource for left and the right virtual ear. With this to distances I have the basic informations for my audio algos. The only thing that I now have to do is to set both playing wavesample or stream to a certain point in the sample (!!! Distance delta = time delay !!!). And than allthough I need to set the lowpass Cutoff freq with 'distance delta'. For more details I would be take more time to explain the audio mathematics that I will use. If you need more infos about my idea you can say it.....

To the second part directx fx:
I have allthought looked at the directx fx but a this point I have found only this fx:

  IDirectSoundFXGargle8 = interface;
  IDirectSoundFXChorus8 = interface;
  IDirectSoundFXFlanger8 = interface;
  IDirectSoundFXEcho8 = interface;
  IDirectSoundFXDistortion8 = interface;
  IDirectSoundFXCompressor8 = interface;
  IDirectSoundFXParamEq8 = interface;
  IDirectSoundFXWavesReverb8 = interface;
  IDirectSoundFXI3DL2Reverb8 = interface;

These are the same effects that are implemented in the Bass_fx.dll I think !!!!

The distortion fx has a prelowpass but.......

  PDSFXDistortion = ^TDSFXDistortion;
  TDSFXDistortion = packed record
    fGain                  : single;
    fEdge                  : single;
    fPostEQCenterFrequency : single;
    fPostEQBandwidth       : single;
    fPreLowpassCutoff      : single;  <-------------- this one
  end;
  PCDSFXDistortion = ^TDSFXDistortion;

The ParamEq .......

  PDSFXParamEq = ^TDSFXParamEq;
  TDSFXParamEq = packed record
    fCenter    : single;
    fBandwidth : single;
    fGain      : single;
  end;

But I don't know exactly if these are the right ones for me.
I think the math functions are different to a simple lp. I only need to make the hole freq spectrum cutted at a frequency.


Thanx for the link.......
I have looked a little bit in your delphi headers... some questions !!!! Please correct me if I am on the wrong way!!

You place the EQRun to a dsp callback - could the buffer pointer only used for streams ? If it so I had the problem to set the stream position .....

Thanx MHTec