BASS for iOS (iPhone/iPad)

Started by Ian @ un4seen,

Ian @ un4seen

An updated iOS package is up (see the 1st post). For convenience, the device and simulator builds have been merged into one, so that no fiddling around with library versions is required.

Jamie Stevens

Hello,

Is it possible to load with BASS an mp3 file from the iPhone's iTunes library? Without this feature there are not so many things to do with BASS on this platform.

I saw other apps in the iTunes doing it, like ringtone designers, DJ apps etc. I don't think they were using BASS though?!

ppeau

Hey guys, with the new version of XCode 4 GM seed 2.
I've got this warning with BASS_FX :

Ld "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos/TurnTable Simulation.app/TurnTable Simulation" normal armv7
    cd "/Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation"
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    setenv PATH "/Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/ppeau/Xcode4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7 -isysroot /Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -L/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos "-L/Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation" -F/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos -filelist "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Intermediates/TurnTable Simulation.build/Debug-iphoneos/TurnTable Simulation.build/Objects-normal/armv7/TurnTable Simulation.LinkFileList" -dead_strip -miphoneos-version-min=4.3 -framework AudioToolbox -framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework Foundation -framework QuartzCore -framework SystemConfiguration -framework UIKit -lbass_fx -lbass -o "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos/TurnTable Simulation.app/TurnTable Simulation"

ld: warning: ignoring file /Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation/libbass_fx.a, file was built for archive which is not the architecture being linked (armv7)

That works like a charm with XCode 3.2 but not with the new release of Xcode 4

Any idea ?

mits

#143
Hi,
I'm having the same issue using Xcode 4 (final release).
Do I need new libs of BASS_FX?

Thanks in advance.

Quote from: ppeauLd "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos/TurnTable Simulation.app/TurnTable Simulation" normal armv7
    cd "/Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation"
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    setenv PATH "/Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/ppeau/Xcode4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7 -isysroot /Users/ppeau/Xcode4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -L/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos "-L/Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation" -F/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos -filelist "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Intermediates/TurnTable Simulation.build/Debug-iphoneos/TurnTable Simulation.build/Objects-normal/armv7/TurnTable Simulation.LinkFileList" -dead_strip -miphoneos-version-min=4.3 -framework AudioToolbox -framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework Foundation -framework QuartzCore -framework SystemConfiguration -framework UIKit -lbass_fx -lbass -o "/Users/ppeau/Library/Developer/Xcode/DerivedData/TurnTable_Simulation-afkttdegvfkwuaehbajwipzwknjd/Build/Products/Debug-iphoneos/TurnTable Simulation.app/TurnTable Simulation"

ld: warning: ignoring file /Users/ppeau/Dropbox/TurnTable Simulation/TurnTable Simulation/libbass_fx.a, file was built for archive which is not the architecture being linked (armv7)

ld: warning: ignoring file /Users/Mitsuhiro/Documents/iPhone APP/robick/libbass_fx.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
  "_BASS_FX_TempoGetSource", referenced from:
      -[AudioControllerBASS setIsReverse:] in AudioControllerBASS.o
      -[AudioControllerBASS setIsHighQuality:] in AudioControllerBASS.o
  "_BASS_FX_TempoCreate", referenced from:
      -[AudioControllerBASS setupBASS:] in AudioControllerBASS.o
  "_BASS_FX_ReverseCreate", referenced from:
      -[AudioControllerBASS setupBASS:] in AudioControllerBASS.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

Ian @ un4seen

Yes, the current BASS_FX build does not include support for armv7 (only armv6). An update will be available shortly, hopefully :)

ppeau

Thanks because XCode 4 is now released  8)

(: JOBnik! :)

Hi ;D

Here's an update 2.4.6.1 beta, that combines support for "armv6/7" architectures and simulator in one file.
http://www.jobnik.org/files/libbass_fx.a

mits

Hi JOBnik,

This beta file seems to work correctly :)

Build of my app succeeded with Xcode 4 and worked on iPhone 4.
I confirmed at least pitch and tempo control function.

Thanks!

Gurt87

Guys, how can i get effect like "Concert hall", "Subway", "Bar", "Sidewalk", etc.   with BASS library?

Serginho

Quote from: Gurt87Guys, how can i get effect like "Concert hall", "Subway", "Bar", "Sidewalk", etc.   with BASS library?

I'm working on the same issue. I've tried to user BASS_FX with different params, but with no results. Any help?

      hfxHandle = BASS_ChannelSetFX(chan, BASS_FX_DX8_FLANGER, 1);
      BASS_DX8_FLANGER bigAreaParams = { 500.0, 36.0, -15.0, 15.0f, 115, 15.0f, 115};
      BASS_FXSetParameters(hfxHandle, &bigAreaParams);

Ian @ un4seen

Quote from: Gurt87Guys, how can i get effect like "Concert hall", "Subway", "Bar", "Sidewalk", etc.   with BASS library?

Preset environments like that are not currently available. You can emulate some of them via the BASS_FX_DX8_REVERB parameters, but probably not all. It may be possible to emulate more environments by adding more effects to it.

Quote from: SerginhoI've tried to user BASS_FX with different params, but with no results. Any help?

      hfxHandle = BASS_ChannelSetFX(chan, BASS_FX_DX8_FLANGER, 1);
      BASS_DX8_FLANGER bigAreaParams = { 500.0, 36.0, -15.0, 15.0f, 115, 15.0f, 115};
      BASS_FXSetParameters(hfxHandle, &bigAreaParams);

Is the BASS_FXSetParameters call reporting success, ie. returning TRUE? I suspect it's failing as some of the parameters appear to be out of range. Please see the BASS_DX8_FLANGER documentation for the valid ranges.

Gurt87

BASS_FXSetParameters returns FALSE each time. We've notices changes only while changing
BASS_ChannelSetFX(chan, BASS_FX_BFX_DAMP, 1);
if we changes params


float fTarget = 0.98f;
float fQuiet = 0.04f;
float fRate = 0.02f;
float fGain = 2.0f;
float fDelay = 0.2f;


hfxHandle = BASS_ChannelSetFX(chan, BASS_FX_BFX_DAMP, 0);
     BASS_BFX_DAMP damp = {fTarget, fQuiet, fRate, fGain, fDelay, chan};
                          BOOL result = BASS_FXSetParameters(hfxHandle, &damp);
we always receive FALSE  

Ian @ un4seen

Please check the error code, using BASS_ErrorGetCode.

Also, is the BASS_ChannelSetFX call successful, ie. is "hfxHandle" non-0? If it is 0, then it suggests that the BASS_FX add-on has not been loaded. Have you added it (LIBBASS_FX.A) to your project's "Link Binary With Libraries" branch?

Also note that the BASS_BFX_DAMP "lChannel" parameter is not a BASS channel handle (eg. "chan"), but rather it determines which audio channels (eg. left/right) the effect should apply to. You can use BASS_BFX_CHANALL to have it apply to all. Please see the BASS_FX documentation for details.

Gurt87

When im use BASS_FX_DX8_REVERB everything is OK. Error code = 0, hfxHandle != 0;
HSTREAM chan;   //typedef DWORD HSTREAM; // sample stream handle
HFX hfxHandle;   //typedef DWORD HFX; // DX8 effect handle

//-----------

hfxHandle = BASS_ChannelSetFX(chan, BASS_FX_DX8_REVERB, 1);
BASS_DX8_REVERB fx;
fx.fInGain = 0;
fx.fReverbMix = 0;
fx.fReverbTime = 100;
fx.fHighFreqRTRatio = 0.001;
BOOL result = BASS_FXSetParameters(hfxHandle, &fx);

//result == TRUE

When im try use BASS_FX_BFX_DAMP, Error code = 19, hfxHandle == 0;

LIBBASS_FX.A in project.
hfxHandle = BASS_ChannelSetFX(chan, BASS_FX_BFX_DAMP, 1);
BASS_BFX_DAMP fx;
fx.fTarget = 0.5;
fx.fQuiet = 0.5;
fx.fRate = 0.5;
fx.fGain = 0;
fx.fDelay = 0.5;
fx.lChannel = BASS_BFX_CHANALL;
BOOL result = BASS_FXSetParameters(hfxHandle, &fx);

//result == FALSE every time

LIBBASS_FX.A in project.

Ian @ un4seen

Error code 19 is BASS_ERROR_ILLTYPE, which means that the "type" parameter (BASS_FX_BFX_DAMP) was not recognised. That would indicate that BASS_FX is not loaded. You may need to add a BASS_FX function call (eg. BASS_FX_GetVersion) to your app to get it linked into your app. If it still doesn't work, do you see any errors in the XCode build log?

Gurt87

When im try call BASS_FX_GetVersion(); im get in my debug log
Undefined symbols:
  "operator delete[](void*)", referenced from:
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
  "operator delete(void*)", referenced from:
      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_Free in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      __textcoal_nt@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __textcoal_nt@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __textcoal_nt@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
  "operator new[](unsigned long)", referenced from:
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
  "operator new(unsigned long)", referenced from:
      _BASS_FX_BPM_CallbackSet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_ReverseGetSource in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_BPM_BeatDecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
      _BASS_FX_TempoCreate in libbass_fx.a(libbass_fx.a-i386-master.o)
  "___cxa_pure_virtual", referenced from:
      __const@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
      __const_coal@0 in libbass_fx.a(libbass_fx.a-i386-master.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

.......



Its mean that FX not working???
But how BASS_FXSetParameters(hfxHandle, &fx)   returns TRUE ??
BASS_FXSetParameters - its function BASS_FX?

vitalic

Hello guys,

I'm finally confused with bass_fx. I've read that latest working copy of bass_fx witch works with ios4 is beta now.
From my own experience, I was unable to add official version libbassfx.a to project, beta works but partially.
Could you please help me with working files and piece of code with bass_fx usage.

I'll be much appreciate your help!
Thanks!

Vitaliy

Ian @ un4seen

Quote from: Gurt87When im try call BASS_FX_GetVersion(); im get in my debug log
Undefined symbols:
  "operator delete[](void*)", referenced from:
      _BASS_FX_BPM_DecodeGet in libbass_fx.a(libbass_fx.a-i386-master.o)
...

Adding "-lstdc++" to your project's "Other Linker Flags" setting should sort that (BASS_FX requires the C++ library).

Quote from: Gurt87But how BASS_FXSetParameters(hfxHandle, &fx)   returns TRUE ??
BASS_FXSetParameters - its function BASS_FX?

BASS_FXSetParameters is a BASS function, as is BASS_ChannelSetFX. The BASS_FX add-on adds support for more effects to those functions.

Gurt87

#158
QuoteAdding "-lstdc++" to your project's "Other Linker Flags" setting should sort that (BASS_FX requires the C++ library).
Thanks! it works!

Now i have another question: how can i get "dump" effect?
if im use BASS_FX_BFX_DUMP i not hear any changes...BASS_FXSetParameters returns TRUE;

Maybe i set bad parameters?

      BASS_BFX_DAMP fx;
      fx.fTarget = 0.98f;
      fx.fQuiet = 0.04f;
      fx.fRate = 0.02f;
      fx.fGain = 2.0f;
      fx.fDelay = 0.2f;
      fx.lChannel = BASS_BFX_CHANALL
 

Ian @ un4seen

The effect of the "DAMP" effect may not be very noticeable. It raises/lowers the level towards a target level (fTarget), but if the sample data is already at/around that level, then it doesn't have much to do :)