Author Topic: BASS for iOS (iPhone/iPad)  (Read 647426 times)

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #900 on: 22 Oct '14 - 18:04 »
Is just changing the BASS_CONFIG_BUFFER setting triggering the problem, or are there other steps required? BASS only uses the BASS_CONFIG_BUFFER value when it creates a playback buffer for a new stream (eg. in a BASS_StreamCreate call), so it should be impossible for BASS_CONFIG_BUFFER changes to affect existing streams. If you're creating a new stream after setting BASS_CONFIG_BUFFER to 10ms, are you sure it isn't that new stream that's having playback problems? 10ms is probably too low for stable playback. If minimal latency is required, it may be better to enable the BASS_ATTRIB_NOBUFFER option instead.

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #901 on: 22 Oct '14 - 20:38 »
Hi, thanks for you concern.
The purpose is for vinyl emulation that you can find here with the source code : http://blog.weareglow.com/2011/01/vinyl-scratch-emulation-on-iphone/

It is something who runs since a longtime and the very small buffer value was selected for a ultra fast variation of the sound just during the scratch.

My first thought, was exactly like you. When the buffer is set, the stream is created with it and it should keep it all the time.
but ??? How can I explain that

Something very important is : if I run the app on ios 7 everything is perfect , it just on ios 8 the problem appear, it is weird too.
Maybe we did something wrong from the start in BASS setting and now the problem is "more visible" with ios 8.
This is why I tried to find a way to verify the current setting of my stream playback.

this is what I did in reality, as you can see it is very simple ( I put the value of the stream to verify which one I use) :

BASS_Init(-1, DEFAULT_FREQUENCY, 0, 0, NULL);
BASS_SetConfig(BASS_CONFIG_BUFFER, 500);
BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, 2);
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 100);


self.streamPlayBack = BASS_StreamCreateFile(0, [Url UTF8String], 0, 0, BASS_SAMPLE_FLOAT|BASS_STREAM_PRESCAN|BASS_STREAM_DECODE); // stream number 1342177279
self.streamReverse = BASS_FX_ReverseCreate(self.streamPlayBack, 1, BASS_STREAM_DECODE); // stream number  1342177278
self.streamTempo = BASS_FX_TempoCreate(self.streamReverse,  BASS_SAMPLE_FLOAT | BASS_FX_FREESOURCE ); // stream number 1342177277

BASS_ChannelSetAttribute(self.streamReverse, BASS_ATTRIB_REVERSE_DIR, BASS_FX_RVS_FORWARD);
BASS_ChannelSetPosition(self.streamTempo, 0, BASS_POS_BYTE);


// Just comment these 3 lines and the playback is perfect
BASS_SetConfig(BASS_CONFIG_BUFFER, 5);
BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, 1);
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 5);

// the stream for the vinyl emulation
streamScratch = BASS_StreamCreate((DWORD) BASE_PLAYBACK_FREQUENCY, 2, BASS_SAMPLE_FLOAT, (DWORD ( *)(HSTREAM, void *, DWORD, void *)) &WriteScratchStream, (__bridge void *)(self)); // stream number 1342177269

// play something
BASS_ChannelPlay(self.streamTempo, true);// stream number 1342177277

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #902 on: 23 Oct '14 - 02:19 »
I tried your stuff BASS_ATTRIB_NOBUFFER, that makes the job for me it's perfect for what I want do.
but that doesn't explain what I experienced  ???

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #903 on: 23 Oct '14 - 14:42 »
// Just comment these 3 lines and the playback is perfect
BASS_SetConfig(BASS_CONFIG_BUFFER, 5);
BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, 1);
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 5);

Is the call sequence exactly as above? If so, the BASS_CONFIG_BUFFER setting may not actually be 5ms because it is restricted by the BASS_CONFIG_UPDATEPERIOD setting, so the latter should be set before the former. The BASS_CONFIG_UPDATEPERIOD setting will affect all streams, so it may well be that that is causing the problem you had. A lower update period is likely to use more CPU in total due to overheads (eg. entering an update cycle) being a larger percentage of CPU usage; each update cycle will use less CPU but there will be more of them. Reducing BASS_CONFIG_UPDATETHREADS from 2 to 1 could also be contributing to the problem, as it means only 1 stream can be updated at a time.

The default device buffer on iOS is usually larger than 5ms, so using a 5ms playback buffer will be problematic anyway, as the stream won't have enough data to fill the device's buffer. It is possible to request a smaller device buffer via the BASS_CONFIG_DEV_BUFFER option (0 = use iOS's default); the actual device buffer length is available from BASS_GetInfo ("minbuf" value). You could check what the buffer lengths are on your iOS 7 and 8 devices, which might explain why one was affected while the other wasn't. Also check the CPU usage, ie. is the affected device more heavily loaded?

Anyway, good to hear that the BASS_ATTRIB_NOBUFFER option is working well for you. Enabling that will usually give better results than using very low BASS_CONFIG_BUFFER and BASS_CONFIG_UPDATEPERIOD settings.

kelan

  • Posts: 1
Re: BASS for iOS (iPhone/iPad)
« Reply #904 on: 29 Oct '14 - 09:54 »
Hello,

Can you give me an simple example?I need an iPhone App for audio playback.
Thank you.

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #905 on: 29 Oct '14 - 12:12 »
// Just comment these 3 lines and the playback is perfect
BASS_SetConfig(BASS_CONFIG_BUFFER, 5);
BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, 1);
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 5);

Is the call sequence exactly as above? If so, the BASS_CONFIG_BUFFER setting may not actually be 5ms because it is restricted by the BASS_CONFIG_UPDATEPERIOD setting, so the latter should be set before the former. The BASS_CONFIG_UPDATEPERIOD setting will affect all streams, so it may well be that that is causing the problem you had. A lower update period is likely to use more CPU in total due to overheads (eg. entering an update cycle) being a larger percentage of CPU usage; each update cycle will use less CPU but there will be more of them. Reducing BASS_CONFIG_UPDATETHREADS from 2 to 1 could also be contributing to the problem, as it means only 1 stream can be updated at a time.

The default device buffer on iOS is usually larger than 5ms, so using a 5ms playback buffer will be problematic anyway, as the stream won't have enough data to fill the device's buffer. It is possible to request a smaller device buffer via the BASS_CONFIG_DEV_BUFFER option (0 = use iOS's default); the actual device buffer length is available from BASS_GetInfo ("minbuf" value). You could check what the buffer lengths are on your iOS 7 and 8 devices, which might explain why one was affected while the other wasn't. Also check the CPU usage, ie. is the affected device more heavily loaded?

Anyway, good to hear that the BASS_ATTRIB_NOBUFFER option is working well for you. Enabling that will usually give better results than using very low BASS_CONFIG_BUFFER and BASS_CONFIG_UPDATEPERIOD settings.

thanks very interesting your advise

fxfletch

  • Posts: 26
Re: BASS for iOS (iPhone/iPad)
« Reply #906 on: 3 Nov '14 - 10:40 »
Hi,

Just coming back to BASS after a while for a new iOS project. Have downloaded all the latest stuff and am working on XCODE 6.1 and am getting the missing required architecture x86_64 build error on libbassmix. Have searched the forum and seen your post where you explain this but I can't see how to set that setting in XCODE 6.1.

Any help would be appreciated

Ian   

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #907 on: 3 Nov '14 - 15:37 »
To avoid the need for fiddling with Xcode project settings, support for the x64_86 architecture is being introuduced in the next build of each library. The BASS and BASSenc libraries have been updated so far, and I have just now put up an updated BASSmix library too.

fxfletch

  • Posts: 26
Re: BASS for iOS (iPhone/iPad)
« Reply #908 on: 3 Nov '14 - 16:56 »
That fixed it  ;D

Thanks for the fast response as always.

Ian

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #909 on: 10 Nov '14 - 18:34 »
Hi, I need some helps about BASS_CONFIG_IOS_MIXAUDIO.
I need to isolate my playback stream from notifications, calls whatever.

At first I tried all the stuffs about AvAudioSession but that do not make the job at all.

So, after that, I tried some settings for BASS_CONFIG_IOS_MIXAUDIO but that changes nothing at all as well, each time the notification cut the playback.

this is why I did :
Bass_SetConfig(BASS_CONFIG_IOS_MIXAUDIO,2);
Bass_Init(...);

Is there a way to really isolate bass from all the sounds who can interrupt it?

EDIT :  I found the "do not disturb" function but is manual (ugly)

Thanks for all because I'm really stuck on this one.
« Last Edit: 10 Nov '14 - 18:51 by ppeau »

GregaK

  • Posts: 22
Re: BASS for iOS (iPhone/iPad)
« Reply #910 on: 12 Nov '14 - 11:55 »
Hi,

a question for BASS developers: i am using effects with a sound. For example a delay. When sound is playing delay works, no problem here. But when i pause playback (just pause, not stop or free or anything else), delay is immediately gone. Is this normal? For flanger, phaser, etc. this is no problem because they are not time effects. But for reverb and delay i would like for them to continue after pause based on fx time parameters of course (fade out not just cut off).

Thanks.

Regards,
Grega

P.S.
Uh one more: i saw that bass was updated (updated: 11 Nov '14) on the first page of this thread. Is there any what's new list (updates, fixes, changes, etc.)?
« Last Edit: 12 Nov '14 - 11:59 by GregaK »

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #911 on: 12 Nov '14 - 13:45 »
Hi,

a question for BASS developers: i am using effects with a sound. For example a delay. When sound is playing delay works, no problem here. But when i pause playback (just pause, not stop or free or anything else), delay is immediately gone. Is this normal? For flanger, phaser, etc. this is no problem because they are not time effects. But for reverb and delay i would like for them to continue after pause based on fx time parameters of course (fade out not just cut off).

Thanks.

Regards,
Grega

P.S.
Uh one more: i saw that bass was updated (updated: 11 Nov '14) on the first page of this thread. Is there any what's new list (updates, fixes, changes, etc.)?

+1
I'm facing the same issue right now.

Thanks for a solution

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #912 on: 12 Nov '14 - 16:39 »
Hi, I need some helps about BASS_CONFIG_IOS_MIXAUDIO.
I need to isolate my playback stream from notifications, calls whatever.

At first I tried all the stuffs about AvAudioSession but that do not make the job at all.

You want to programmatically disable incoming calls while your app is running? I'm not sure that's possible, but if you would like to try experimenting with the Audio Session options, you can use this new BASS_CONFIG_IOS_NOCATEGORY option to stop BASS handling that stuff...

Code: [Select]
#define BASS_CONFIG_IOS_NOCATEGORY 51
BASS_SetConfig(BASS_CONFIG_IOS_NOCATEGORY, 1); // disable BASS's audio session category management

When that's enabled the BASS_CONFIG_IOS_MIXAUDIO/SPEAKER settings have no effect.

a question for BASS developers: i am using effects with a sound. For example a delay. When sound is playing delay works, no problem here. But when i pause playback (just pause, not stop or free or anything else), delay is immediately gone. Is this normal? For flanger, phaser, etc. this is no problem because they are not time effects. But for reverb and delay i would like for them to continue after pause based on fx time parameters of course (fade out not just cut off).

If I understand correctly, what you want is for the effect's tail to continue being processed when a stream is paused/stopped? That isn't possible with a single stream because the effects are applied to the stream's sample data as it is decoded, so if there is no decoding/playing, then there can be no effect processing. A solution is to use 2 streams: a decoder that feeds an output stream, which has the effects set on it. The output stream could be a mixer, something like this...

Code: [Select]
decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE|BASS_SAMPLE_FLOAT); // create decoder
BASS_CHANNELINFO ci;
BASS_ChannelGetInfo(decoder, &ci); // get sample format
output=BASS_Mixer_StreamCreate(ci.freq, ci.chans, BASS_MIXER_NONSTOP|BASS_SAMPLE_FLOAT); // create a nonstop mixer with same format
BASS_Mixer_StreamAddChannel(output, decoder, 0); // plug the decoder into the mixer
BASS_ChannelSetFX(output, ...); // set an effect on the mixer
BASS_ChannelPlay(output, 0); // start it

To pause/resume the decoder, you can use BASS_Mixer_ChannelFlags to set/remove the BASS_MIXER_PAUSE flag. Note that the mixer will add some latency to the pausing/resuming due to buffering. If you would like to reduce that, you can lower the BASS_CONFIG_BUFFER setting (perhaps BASS_CONFIG_UPDATEPERIOD too).

i saw that bass was updated (updated: 11 Nov '14) on the first page of this thread. Is there any what's new list (updates, fixes, changes, etc.)?

The update fixed a bug that was introduced recently, which would result in a crash when iOS's audio route changes (eg. when (dis)connecting headphones) while playing samples (HCHANNELs).

GregaK

  • Posts: 22
Re: BASS for iOS (iPhone/iPad)
« Reply #913 on: 12 Nov '14 - 19:00 »
Quote
If I understand correctly, what you want is for the effect's tail to continue being processed when a stream is paused/stopped? That isn't possible with a single stream because the effects are applied to the stream's sample data as it is decoded, so if there is no decoding/playing, then there can be no effect processing. A solution is to use 2 streams: a decoder that feeds an output stream, which has the effects set on it. The output stream could be a mixer, something like this...

Yes exactly. I have tried your suggestion and it works. However latency is almost unexceptable. I will try to play with buffer settings.
Sub-question: will this work with BASS_StreamCreateURL to play iPod library entries directly?

Quote
To pause/resume the decoder, you can use BASS_Mixer_ChannelFlags to set/remove the BASS_MIXER_PAUSE flag. Note that the mixer will add some latency to the pausing/resuming due to buffering. If you would like to reduce that, you can lower the BASS_CONFIG_BUFFER setting (perhaps BASS_CONFIG_UPDATEPERIOD too).

What will happen when song will finish (i haven't try it yet) - will effect tail or stop?

Thanks.

Regards,
Grega

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #914 on: 13 Nov '14 - 05:03 »
Quote
What will happen when song will finish (i haven't try it yet) - will effect tail or stop?

I tested it, that works. the effect continue at the end.

So now, I need advice from you Ian.
In my project everything is set with Bass_ChannelPause() or Bass_ChannelPlay(), I've got HSYNC for loop, other stream for vinyl emulation, end or start reaching detection plug to the main stream and is fast.

So what I have to do in order to have the sound effect apply with all of my things (HSYNC, vinyl, etc.).Change everything for the mixer, or can I keep everything intact but change just the pause resume management with the BASS_Mixer_ChannelFlags and all the setposition, tempo, reverse etc. will still continue to work as before, but now in the mixer?

And, do I include the other stream for my vinyl emulation in the same mixer and just switch in real time with BASS_Mixer_ChannelFlags to select which one I want to heard, it might be better?

I'm also a little bit worried about the latency for the loop, or set position that I have everywhere, that will be no impact or everything will suffer about the latency.

Sorry for all of these questions but seems to me a big deal now to fix this issue, no?

Thanks for all


Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #915 on: 13 Nov '14 - 15:47 »
Sub-question: will this work with BASS_StreamCreateURL to play iPod library entries directly?

Yes, it can be applied to any type of stream.

What will happen when song will finish (i haven't try it yet) - will effect tail or stop?

The mixer will continue processing even when it has no sources (due to BASS_MIXER_NONSTOP), and as the effect is applied to the mixer rather than the source, so the effect processing will continue too.

In my project everything is set with Bass_ChannelPause() or Bass_ChannelPlay(), I've got HSYNC for loop, other stream for vinyl emulation, end or start reaching detection plug to the main stream and is fast.

So what I have to do in order to have the sound effect apply with all of my things (HSYNC, vinyl, etc.).Change everything for the mixer, or can I keep everything intact but change just the pause resume management with the BASS_Mixer_ChannelFlags and all the setposition, tempo, reverse etc. will still continue to work as before, but now in the mixer?

Yes, the loop syncs and tempo/reverse processing should still be applied to the source. To avoid extra latency when seeking (outside the syncs), you could also clear the mixer's playback buffer by calling BASS_ChannelPlay with restart=TRUE or BASS_ChannelSetPosition with pos=0. For example, like this...

Code: [Select]
BASS_ChannelPause(mixer); // pause the mixer
BASS_ChannelSetPosition(source, ...); // set source position
BASS_ChannelPlay(mixer, TRUE); // restart the mixer (clear buffer)

If you want to know the source's current position, you can use BASS_Mixer_ChannelGetPosition instead of BASS_ChannelGetPosition, as it will take account of the mixer's buffering to give the position actually being heard.

And, do I include the other stream for my vinyl emulation in the same mixer and just switch in real time with BASS_Mixer_ChannelFlags to select which one I want to heard, it might be better?

Yes, if you would like to have the same effects applied to both, then you could use the same mixer to play both. To avoid extra latency when switching the sources, you could again clear the mixer's playback buffer...

Code: [Select]
BASS_ChannelPause(mixer); // pause the mixer
BASS_Mixer_ChannelFlags(source1, BASS_MIXER_PAUSE, BASS_MIXER_PAUSE); // pause source1
BASS_Mixer_ChannelFlags(source2, 0, BASS_MIXER_PAUSE); // un-pause source2
BASS_ChannelPlay(mixer, TRUE); // restart the mixer (clear buffer)

One thing to note is that clearing the mixer's playback buffer will result in a discontinuity in the output. If you need the effect output to be uninterrupted while seeking and/or source switching, then there are a couple of other options that you can try. You could reduce the mixer's buffer length via BASS_CONFIG_BUFFER (and BASS_CONFIG_UPDATEPERIOD), or you could enable the BASS_ATTRIB_NOBUFFER option on it. Please see the documentation for details on those options.

GregaK

  • Posts: 22
Re: BASS for iOS (iPhone/iPad)
« Reply #916 on: 16 Nov '14 - 19:00 »
Hi Ian,

first a big thank you for the support. I really appreciate it.
Hopefully you don't find this annoying and that this questions and answers will make this forum a great source for all iOS BASS developers.

OK, back to business. I have tried your examples, everything works as expected. But of course new questions arise when working with this new code:

1. When using mixer channel for effects to continue to work after decoder is paused how to check when decoder has reached the end (end of the song)? With GetPosition or callback or something else? Because mixer channel is non-stop and status will always be playing. Should i create a callback to decoder then? Also note that decoder is iPod library file so an example for this would be very useful.

2. Is it possible to sync mixer/decoder to so called master tempo (bpm)? Let's say i have a master bpm set to 120 BPM and when i load a new song i set the bpm to 120 and then i would like to sync start (sync to beat or something like that).

3. I also noticed one thing - when effect is applied to a mixer channel and decoder is paused or reached the end CPU is still on 5% until i remove the effect from mixer. Which would mean i have to remove all the effects when decoder is paused/ended and put them all back when playing. Is there any better solution for this to save CPU?

Thanks again.

Regards,
Grega
« Last Edit: 17 Nov '14 - 07:28 by GregaK »

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #917 on: 17 Nov '14 - 16:52 »
1. When using mixer channel for effects to continue to work after decoder is paused how to check when decoder has reached the end (end of the song)? With GetPosition or callback or something else? Because mixer channel is non-stop and status will always be playing. Should i create a callback to decoder then? Also note that decoder is iPod library file so an example for this would be very useful.

You can set a BASS_SYNC_END sync on the source via BASS_Mixer_ChannelSetSync to be informed of when the mixer has finished playing it. You can also call BASS_ChannelIsActive on the source (rather than the mixer), but that will report the end a bit before it is actually heard, due to the mixer's playback buffering.

2. Is it possible to sync mixer/decoder to so called master tempo (bpm)? Let's say i have a master bpm set to 120 BPM and when i load a new song i set the bpm to 120 and then i would like to sync start (sync to beat or something like that).

It is possible to start a new source at a precise position (eg. on a beat) in the mix by setting a "mixtime" BASS_SYNC_POS on the mixer and adding the source to the mixer in the SYNCPROC callback.

3. I also noticed one thing - when effect is applied to a mixer channel and decoder is paused or reached the end CPU is still on 5% until i remove the effect from mixer. Which would mean i have to remove all the effects when decoder is paused/ended and put them all back when playing. Is there any better solution for this to save CPU?

I think pausing/stopping the mixer via BASS_ChannelPause/Stop when its not needed would be simpler and more efficient. You could use BASS_ChannelGetLevel in a timer to decide when to do that, ie. if there are no sources playing and the mixer's level is silent (or close to it), then pause/stop the mixer, and resume it via BASS_ChannelPlay (possibly with restart=TRUE) when resuming the source.

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #918 on: 19 Nov '14 - 04:25 »
Yes, if you would like to have the same effects applied to both, then you could use the same mixer to play both. To avoid extra latency when switching the sources, you could again clear the mixer's playback buffer...

Code: [Select]
BASS_ChannelPause(mixer); // pause the mixer
BASS_Mixer_ChannelFlags(source1, BASS_MIXER_PAUSE, BASS_MIXER_PAUSE); // pause source1
BASS_Mixer_ChannelFlags(source2, 0, BASS_MIXER_PAUSE); // un-pause source2
BASS_ChannelPlay(mixer, TRUE); // restart the mixer (clear buffer)

Hi, I back to you with a couple of issues.
First, I cannot use the pause on the mixer, that cuts the effect and it is exactly what I'm trying to avoid :-)
Code: [Select]
BASS_ChannelPause(mixer); // pause the mixer


Then how can I know the state of the sources in the mixer?
Because Bass_ChannelIsActive works just for the mixer, not for the sources. I tried many stuffs and they're always at BASS_ACTIVE_PLAYING.
But I needs to know which one is playing, I looked at the documentation but nothing is available I was expecting a stuff like BASS_Mixer_ChannelGetCurrentFlags(source) or BASS_Mixer_ChannelIsActive(mixer,source) for example ?

Thanks a lot

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #919 on: 19 Nov '14 - 14:47 »
As well as modifying a mixer source's flags, BASS_Mixer_ChannelFlags can be used (with mask=0) to get the current flags...

Code: [Select]
DWORD flags=BASS_Mixer_ChannelFlags(source, 0, 0); // get the source's mixer flags
BOOL paused=flags&BASS_MIXER_PAUSE;

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #920 on: 19 Nov '14 - 14:57 »
As well as modifying a mixer source's flags, BASS_Mixer_ChannelFlags can be used (with mask=0) to get the current flags...

Code: [Select]
DWORD flags=BASS_Mixer_ChannelFlags(source, 0, 0); // get the source's mixer flags
BOOL paused=flags&BASS_MIXER_PAUSE;

Great thanks a lot for the information

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #921 on: 21 Nov '14 - 03:12 »
Hi, new and I hope last question for the effects.

I have my stream playing with the mixer.
I start an echo effect then I pause the mixer and the effect stop smoothly with a long and amazing feedback for my example.

Now I try a new stuff, I start my mixer then I start my effect and now I want to stop it but during the playing.
and "too bad", the effect cut brutally.

Example of what I tried :

Code: [Select]

// Start effect
HFX_ = BASS_ChannelSetFX(mixer_, BASS_FX_BFX_ECHO4, 100);
BASS_BFX_ECHO4 parameters;
parameters.fDryMix = 0.5;
parameters.fWetMix = 0.9;
parameters.fFeedback = 0.5;
parameters.fDelay = 0.240;
parameters.bStereo = NO;
parameters.lChannel = BASS_BFX_CHANALL;
BASS_FXSetParameters(HFX_, &parameters);


// Stop effect way 1
BASS_ChannelRemoveFX(mixer_, HFX_); // cut the effect


// Stop effect way 2
BASS_BFX_ECHO4 parameters;
parameters.fDryMix = 1.0;
parameters.fWetMix = 0.0;
parameters.fFeedback = 0.5;
parameters.fDelay = 0.240;
parameters.bStereo = NO;
parameters.lChannel = BASS_BFX_CHANALL;
BASS_FXSetParameters(HFX_, &parameters); // cut the effect as well


is there a way to stop the effect with a smooth manner during the playback, like we did with the pause technic of the mixer ?

thanks patrice

Ian @ un4seen

  • Administrator
  • Posts: 22121
Re: BASS for iOS (iPhone/iPad)
« Reply #922 on: 24 Nov '14 - 13:22 »
I think you're on the right track with "way 2", but instead of setting "fDryMix" and "fWetMix" to "off" values immediately, you should make those changes in steps, eg. with a timer.

GregaK

  • Posts: 22
Re: BASS for iOS (iPhone/iPad)
« Reply #923 on: 25 Nov '14 - 09:37 »
Hi,

i am using BASS_FX_BPM_BeatDecodeGet to get beats. If i use this function when stream is not playing (set start and end parameters) i get the first beat let's say at 0.38 seconds. When beat is playing i get the first beat at 0.32 seconds, which is the correct time! Why BASS_FX_BPM_BeatDecodeGet returns wrong first beat if stream is not playing? Or maybe am i doing something wrong?

Thank you.

Regards,
Grega

Cristian1980

  • Posts: 67
Re: BASS for iOS (iPhone/iPad)
« Reply #924 on: 27 Nov '14 - 10:35 »
Hi,

Bass fx is missing 64 bit simulator support. Can you please add it?
I would like to do some tests before my device arrives, especially  since, on February 1st 2015 all iOS application must provide 64bits support(https://developer.apple.com/news/?id=10202014a).

Quote
#lipo -info libbass_fx.a
Architectures in the fat file: libbass_fx.a are: armv6 armv7 armv7s i386 arm64

#lipo -info libbass.a
Architectures in the fat file: libbass.a are: armv7 armv7s arm64 armv6 i386 x86_64

Thank you