BASS_FX 2.4.12.1

Started by (: JOBnik! :),

(: JOBnik! :)

Hi ;D

Quote from: SkyerHello guys. Now I developing an audio player and I interfere with some problems with equalizer. When I use profile Full Bass & Treble. May be I use a wrong value of bandwidth? I do 18-line eqalizer with next frequencis
31,63,125,170,250,310,600,1000,1500,2000,3000,4000,6000,8000,10000,12000,14000,16000 Hz and
write this code (I use Delphi)
  for i := 1 to BandsCount do begin
    fx[i] := BASS_ChannelSetFX(Channel, BASS_FX_DX8_PARAMEQ, 1);
    BASS_FXGetParameters(fx[i], @parameq);
    parameq.fCenter := parameq_bands[i];//parameq_bands - array with frequencis values
    parameq.fBandwidth:=1.5;
    parameq.fGain:=0;
    BASS_FXSetParameters(fx[i], @parameq);
  end;

Please, help me :)

BASS_FX_DX8_PARAMEQ won't support frequencies below 80Hz, to support them please use BASS_FX add-on with BASS_FX_BFX_PEAKEQ effect ;)

Skyer

Ok, thank you. But is my value of Gain is right?

Jonathan

Quote from: JonathanCan you use BASS_FX_TempoCreate with a dummy stream on the iPhone?  When I try to do it I get BASS_ERROR_NOTAVAIL from the call to BASS_FX_TempoCreate.

BASS_FX_TempoCreate function should get a decoded stream, i.e: created using BASS_STREAM_DECODE flag. Please show you code to see where's the problem.
[/quote]

Sure thing!  Thanks for getting back to me.. here's what I'm doing:

To init:
BASS_Init(0, 44100, 0, NULL, NULL);
HSTREAM fx_stream = BASS_StreamCreate(44100, 1, BASS_STREAM_DECODE, STREAMPROC_DUMMY, NULL);

// Then I create the resampled stream
fx_stream = BASS_FX_TempoCreate(fx_stream, BASS_STREAM_DECODE);

// Change the pitch
BASS_ChannelSetAttribute(fx_stream, BASS_ATTRIB_TEMPO_PITCH, 2)

Then in my decoding loop:
BASS_ChannelGetData(fx_stream, abl->mBuffers[0].mData, abl->mBuffers[0].mDataByteSize)

The result is silence.  If I remove the ChannelGetData function I hear the unchanged sound.  If I replace with a BASS effect (ie: reverb) it works, but anything driven by BASS_FX yields silence.

Any ideas?

(: JOBnik! :)

Hi ;D

Quote from: SkyerOk, thank you. But is my value of Gain is right?

fGain value is in dB -15....0....+15, when 0 the filter won't change sound for specific band.

Quote from: Jonathan
Quote from: JonathanCan you use BASS_FX_TempoCreate with a dummy stream on the iPhone?  When I try to do it I get BASS_ERROR_NOTAVAIL from the call to BASS_FX_TempoCreate.

QuoteBASS_FX_TempoCreate function should get a decoded stream, i.e: created using BASS_STREAM_DECODE flag. Please show you code to see where's the problem.

Sure thing!  Thanks for getting back to me.. here's what I'm doing:

To init:
BASS_Init(0, 44100, 0, NULL, NULL);
HSTREAM fx_stream = BASS_StreamCreate(44100, 1, BASS_STREAM_DECODE, STREAMPROC_DUMMY, NULL);

// Then I create the resampled stream
fx_stream = BASS_FX_TempoCreate(fx_stream, BASS_STREAM_DECODE);

// Change the pitch
BASS_ChannelSetAttribute(fx_stream, BASS_ATTRIB_TEMPO_PITCH, 2)

Then in my decoding loop:
BASS_ChannelGetData(fx_stream, abl->mBuffers[0].mData, abl->mBuffers[0].mDataByteSize)

The result is silence.  If I remove the ChannelGetData function I hear the unchanged sound.  If I replace with a BASS effect (ie: reverb) it works, but anything driven by BASS_FX yields silence.

Any ideas?

Please read in this thread for an answer:
http://www.un4seen.com/forum/?topic=11377.msg79195#msg79195

Skyer

(: JOBnik! :) : Sorry, I confused a Gain value with Bandwidth. I wanted to ask, is my value of Bandwidth normal? What value of bandwidth is better?

Coding_Carlos

Hi, I want to use BASS_FX in my iPhone application - there will be a paid and free version. What are the licensing issues? --- I will be using effects, i.e. reverb/chorus and pitch

Ian @ un4seen

Quote from: SkyerSorry, I confused a Gain value with Bandwidth. I wanted to ask, is my value of Bandwidth normal? What value of bandwidth is better?

I think the bandwidth (1.5 octaves) is probably a bit high. Also, as your band centre frequencies aren't evenly spaced, the bands will be overlapping each other by varying amounts. If you would like to have 18 equally spaced bands, you could use a bandwidth of 0.5 octaves with the following centre frequencies: 44, 63, 88, 125, 177, 250, 354, 500, 707, 1000, 1414, 2000, 2828, 4000, 5657, 8000, 11314, 16000.

DrummerB

Does anyone experience playback performance issues on the iPhone? I'm testing on a iPhone 3GS and when using tempo or pitch modified playback I experience lag. Tempo manipulation itself word very well, but as soon as I start scrolling a table view the playback starts to lag. I basically implemented the tempo sample from the OSX version for testing. Maybe playback should be done in a separate thread? Or am I doing something wrong? Thanks.

(: JOBnik! :)

Hi ;D

Quote from: DrummerBDoes anyone experience playback performance issues on the iPhone? I'm testing on a iPhone 3GS and when using tempo or pitch modified playback I experience lag. Tempo manipulation itself word very well, but as soon as I start scrolling a table view the playback starts to lag. I basically implemented the tempo sample from the OSX version for testing. Maybe playback should be done in a separate thread? Or am I doing something wrong? Thanks.

I didn't test BASS_FX on iPhone, but if there's a performance issue with it, please try to use:
BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO and BASS_ATTRIB_TEMPO_OPTION_PREVENT_CLICK
attributes.

It will reduce a sound quality a bit.

japostoles

I'm getting EXC_BAD_ACCESS when using the tempo changing functions on an iPhone 3G.

My audio comes from a file using audio units, so I have the following so I have a BASS_StreamPutData using the BASS_FX_TempoGetSource() as the source, and then a BASS_ChannelGetData() to retrieve the data.

The EXC_BAD_ACCESS occurs randomly, and only when I have the BASS_ChannelGetData() in there.  If I just have the PutData in there it's fine.. but it's when I call the get it decides to crash at some point.

Any ideas?  The back trace shows different points, so it's not helpful when debugging.  I'm assuming it's some kind of memory access issue?

(: JOBnik! :)

Hi ;D

Can you please provide some error log?

japostoles

As far as I can tell, the crash seems to occur in the thread right here:


#0  0x0000c958 in BASS_FX_BPM_BeatDecodeGet ()
#1  0x0000c460 in BASS_FX_BPM_BeatDecodeGet ()
#2  0x0000ce4c in BASS_FX_BPM_BeatDecodeGet ()
#3  0x0000d93c in BASS_FX_BPM_BeatDecodeGet ()
#4  0x0000f30c in BASS_FX_BPM_BeatDecodeGet ()
#5  0x000323ac in BASS_ChannelSetPosition ()
#6  0x000331a0 in BASS_ChannelGetData ()

What's strange is I'm not using any BPM functions, just the Tempo, but I'm assuming you use it in the library for the tempo changes  I'm making a call to BASS_ChannelGetData().

Skyer

Hello. I changed my code, but sound is not good yet. :-\ This my code

  Channel := BASS_StreamCreateFile(FALSE,
    PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);

  If Channel = 0 Then
      Channel := BASS_MusicLoad(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_MUSIC_RAMP or BASS_MUSIC_DECODE or BASS_MUSIC_PRESCAN or  BASS_MUSIC_AUTOFREE, 0);
  If Channel = 0 then
      Channel := BASS_WMA_StreamCreateFile(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);
  If Channel = 0 then
      Channel := BASS_FLAC_StreamCreateFile(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);
  If Channel = 0 then
  begin
    Error('Selected file couldnt be loaded!');
    exit;
  end;

  Channel := BASS_FX_TempoCreate(Channel, BASS_FX_FREESOURCE or  BASS_STREAM_AUTOFREE);
  If (Channel = 0) Then
  begin
    Error('Couldn''t create a resampled stream!');
    BASS_StreamFree(Channel);
    BASS_MusicFree(Channel);
    exit;
  End;

  FX_parameq := BASS_ChannelSetFX(channel, BASS_FX_BFX_PEAKEQ, 0);

  parameq.fGain := 0;
  parameq.fQ := 0;
  parameq.fBandwidth :=0.5;
  parameq.lChannel := BASS_BFX_CHANALL;

  for i := 0 to BandsCount-1 do begin
    parameq.lBand := i;
    parameq.fCenter := parameq_bands[i];
    BASS_FXSetParameters(FX_parameq, @parameq);
  end;

In trackbars OnChange notify I use this code

BASS_FXGetParameters(FX_parameq, @parameq);
parameq.lBand:=TrackBarIndex-1;
parameq.fgain :=TrackBar.Value-15;
BASS_FXSetParameters(FX_parameq, @parameq);

I use this bands 31,63,125,170,250,310,600,1000,1500,2000,3000,4000,6000,8000,10000,12000,14000,16000
And when I used 44, 63, 88, 125, 177, 250, 354, 500, 707, 1000, 1414, 2000, 2828, 4000, 5657, 8000, 11314, 16000, I too had bad sound.

(: JOBnik! :)

Hi ;D

Please read in these threads to find an answer:
http://www.un4seen.com/forum/?topic=11484.0
http://www.un4seen.com/forum/?topic=10231.msg71350#msg71350

Quote from: SkyerHello. I changed my code, but sound is not good yet. :-\ This my code

  Channel := BASS_StreamCreateFile(FALSE,
    PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);

  If Channel = 0 Then
      Channel := BASS_MusicLoad(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_MUSIC_RAMP or BASS_MUSIC_DECODE or BASS_MUSIC_PRESCAN or  BASS_MUSIC_AUTOFREE, 0);
  If Channel = 0 then
      Channel := BASS_WMA_StreamCreateFile(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);
  If Channel = 0 then
      Channel := BASS_FLAC_StreamCreateFile(FALSE,
      PChar(SknLbPlaylist.Items[CurSongIndex]), 0, 0,
      BASS_UNICODE or BASS_STREAM_DECODE or  BASS_STREAM_AUTOFREE);
  If Channel = 0 then
  begin
    Error('Selected file couldnt be loaded!');
    exit;
  end;

  Channel := BASS_FX_TempoCreate(Channel, BASS_FX_FREESOURCE or  BASS_STREAM_AUTOFREE);
  If (Channel = 0) Then
  begin
    Error('Couldn''t create a resampled stream!');
    BASS_StreamFree(Channel);
    BASS_MusicFree(Channel);
    exit;
  End;

  FX_parameq := BASS_ChannelSetFX(channel, BASS_FX_BFX_PEAKEQ, 0);

  parameq.fGain := 0;
  parameq.fQ := 0;
  parameq.fBandwidth :=0.5;
  parameq.lChannel := BASS_BFX_CHANALL;

  for i := 0 to BandsCount-1 do begin
    parameq.lBand := i;
    parameq.fCenter := parameq_bands[i];
    BASS_FXSetParameters(FX_parameq, @parameq);
  end;

In trackbars OnChange notify I use this code

BASS_FXGetParameters(FX_parameq, @parameq);
parameq.lBand:=TrackBarIndex-1;
parameq.fgain :=TrackBar.Value-15;
BASS_FXSetParameters(FX_parameq, @parameq);

I use this bands 31,63,125,170,250,310,600,1000,1500,2000,3000,4000,6000,8000,10000,12000,14000,16000
And when I used 44, 63, 88, 125, 177, 250, 354, 500, 707, 1000, 1414, 2000, 2828, 4000, 5657, 8000, 11314, 16000, I too had bad sound.

Knight_Rider

Some fancy new effects for Bass_FX would be cool... Have been waiting so long for this!

darren

I'm trying to find parameter settings that will produce an audible change using the BASS_BFX_BQF_HIGHSHELF
(in iOS). Calling the toggleHighKill method below produces no audible result.


// define the handle
self.newStream = BASS_StreamCreateFile(FALSE, [fileName cStringUsingEncoding:NSUTF8StringEncoding], 0, 0, BASS_STREAM_DECODE|BASS_SAMPLE_MONO);

self.tempoStream = BASS_FX_TempoCreate(newStream, BASS_STREAM_DECODE);
   
self.killHandle = BASS_ChannelSetFX(tempoStream, BASS_FX_BFX_BQF, 2);


// method
- (void) toggleHighKill
{
   BASS_BFX_BQF fx;
   fx.lFilter = BASS_BFX_BQF_HIGHSHELF;
   fx.fCenter = 12000.0;
   fx.lChannel = BASS_BFX_CHANALL;
   if ( self.highKillIsOn == YES) {
      fx.fGain = 0;
      fx.fBandwidth = 5.0;
      fx.fQ = 1.0;
      fx.fS = 0.5;
      self.highKillIsOn = NO;
      DLog("high kill turned off\n");
   } else {
      fx.fGain = -15.0;
      fx.fBandwidth = 5.0;
      fx.fQ = 1.0;
      fx.fS = 0.5;
      self.highKillIsOn = YES;
      DLog("high kill turned on\n");
   }
   
   BASS_FXSetParameters(self.killHandle, &fx);   
}

I can successfully apply other FX to the tempoStream.

Any suggestions welcome.

(: JOBnik! :)

#536
Hi ;D

Quote from: Knight_RiderSome fancy new effects for Bass_FX would be cool... Have been waiting so long for this!
Please write which you have in mind? :)

Quote from: darrenI'm trying to find parameter settings that will produce an audible change using the BASS_BFX_BQF_HIGHSHELF
(in iOS). Calling the toggleHighKill method below produces no audible result.


// define the handle
self.newStream = BASS_StreamCreateFile(FALSE, [fileName cStringUsingEncoding:NSUTF8StringEncoding], 0, 0, BASS_STREAM_DECODE|BASS_SAMPLE_MONO);

self.tempoStream = BASS_FX_TempoCreate(newStream, BASS_STREAM_DECODE);
   
self.killHandle = BASS_ChannelSetFX(tempoStream, BASS_FX_BFX_BQF, 2);


// method
- (void) toggleHighKill
{
   BASS_BFX_BQF fx;
   fx.lFilter = BASS_BFX_BQF_HIGHSHELF;
   fx.fCenter = 12000.0;
   fx.lChannel = BASS_BFX_CHANALL;
   if ( self.highKillIsOn == YES) {
      fx.fGain = 0;
      fx.fBandwidth = 5.0;
      fx.fQ = 1.0;
      fx.fS = 0.5;
      self.highKillIsOn = NO;
      DLog("high kill turned off\n");
   } else {
      fx.fGain = -15.0;
      fx.fBandwidth = 5.0;
      fx.fQ = 1.0;
      fx.fS = 0.5;
      self.highKillIsOn = YES;
      DLog("high kill turned on\n");
   }
   
   BASS_FXSetParameters(self.killHandle, &fx);   
}

I can successfully apply other FX to the tempoStream.

Any suggestions welcome.

There're params that you can't set for certain filters, if you would check for BASS_ErrorGetCode, you would notice the error code 20 (BASS_ERROR_ILLPARAM - an illegal parameter was specified)

e.g:
For Shelving filters you don't use the params (set them to 0 value to not use them):
fBandwidth
fQ


but must set the fS param as you already do :)

btw, if you need less/more fGain, you can go over -+15dB ;)

Knight_Rider

Hey jobnik :P
did you ever try virtualdj? they have some really cool FX, like beat-doubling where they repeat every beat and then jump back and forward, don't quite know how to describe that, but it sounds kinda cool :)

i know this can be partly done with several timers and other complicated functions in bass already, but it would be way less complicated if bass fx would offer such an effect... or other cool effects, try virtualdj, it'll surely inspire you :)

Bonvie

Hi JOBnik,
regarding virtualdj it would be great to have as "fancy new effect" an easy way to match beats, so that beat matching is done by bass_fx and not by the application. (http://www.un4seen.com/forum/?topic=9460.0)

In my point of view it would be great to be able to match beats, even if it is not perfect. But actually I'm not able to do with my current knowledge and time for the private projects.  :(

jjohnston

JOBnik,

Is there an option in SoundTouch to reset phase at specific points in the timestretching process? I think one of the key differences between this time stretching algorithm and others out there is that others reset phase on percussive transients. This serves to reduce the amount of echo/flamming you hear when slowing down songs. Is there any way to combine beat detection and the phase vocoder to do this? Have you ever experimented with this? If it was possible and had any sort of effect, it would be great to get this option included in BASS_FX.