Author Topic: BASSmix beta (mixing & resampling add-on)  (Read 125120 times)

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #25 on: 9 Nov '05 - 13:34 »
...but still no sound when I plug a channel into the mixer stream. I really don't have any ideas!  :(

Are you using the updated BASS.DLL that's in the BASSmix ZIP? It enables the playback attributes (freq/vol/pan) to be used with decoding channels, so that BASSmix can use them, and avoid the need for separate BASS_Mixer_ChannelSet/GetAttributes functions.

3delite

  • Posts: 895
Re: BASSmix beta (mixing & resampling add-on)
« Reply #26 on: 9 Nov '05 - 16:59 »

That's it! :)
I now got a problem that it is playing way to silently.
Anyway I have to take it as an experimental future becouse it interferes with the VU.
I come up with an idea about it tough. You could make a little change to:
 
Code: [Select]
function BASS_ChannelGetLevel(handle: DWORD; NoPosChange: Boolean): DWORD;

...so that it positions back to where it was after getting the level values. :)
 

3delite

  • Posts: 895
Re: BASSmix beta (mixing & resampling add-on)
« Reply #27 on: 9 Nov '05 - 18:36 »
 
How does BASS_Mixer_ChannelRemove() work?
I now want to remove (unplug) the playing stream but don't understand how it works, becouse it has just one parameter!? The channel handle.
 
Code: [Select]
BASS_Mixer_ChannelRemove(DWORD handle);

I can't specify the mixer channel from where to unplug or what? How does it know from where to unplug?
 

engineeer

  • Posts: 86
Re: BASSmix beta (mixing & resampling add-on)
« Reply #28 on: 9 Nov '05 - 20:47 »
Quote
How does it know from where to unplug?
Hehe, it must be some kind of intelligent mixer  ;D
Channel handle is unique, and you can plug it in mixer only once, so there's no problem to find out where to unplug, right?  ;)

Btw. @ Ian: BASS_Mixer_ChannelSetPosition "resets things for the channel". What things? I'm just curious...
« Last Edit: 9 Nov '05 - 20:53 by engineeer »

3delite

  • Posts: 895
Re: BASSmix beta (mixing & resampling add-on)
« Reply #29 on: 9 Nov '05 - 21:26 »
 
So that means I can't have two mixer channels? Or I can't plug a stream into two mixer channels at once? ::)

The sound volume issue is sorted now, I had set the ASIO channel's volume in the Control Panel/Mixer settings too low, and forgot them there... :)
 

engineeer

  • Posts: 86
Re: BASSmix beta (mixing & resampling add-on)
« Reply #30 on: 9 Nov '05 - 22:31 »
Quote
So that means I can't have two mixer channels? Or I can't plug a stream into two mixer channels at once?

You can't plug a source channel into two mixers at once. Take a look at remarks for BASS_Mixer_StreamAddChannel in BASSmix documentation.

3delite

  • Posts: 895
Re: BASSmix beta (mixing & resampling add-on)
« Reply #31 on: 9 Nov '05 - 22:43 »
 
I see... Nice! :)

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #32 on: 10 Nov '05 - 17:06 »
I'm trying to combine one or more mp3s into one mp3, back to back.

I took the contest.c example and tried to port it into VB.NET I got pretty far. I'm passing in "44100 2 <file1> <file2>"

Depending on the BASS_Init device, and the decode flags, I'm getting it to show the times, and run through the first file, then it hangs. The MP3 it created is the right size, but no sound.

Are you using the updated BASS.DLL from the BASSmix ZIP?

Btw, there's no need to call BASS_Start, and you could use the "no sound" device (0) if you're just writing to disk :)

Btw. @ Ian: BASS_Mixer_ChannelSetPosition "resets things for the channel". What things? I'm just curious...

Resampling stuff, and also position reporting stuff (when the mixer output is being played), ie. if you seek with BASS_ChannelSetPosition, BASS_Mixer_ChannelGetPosition won't immediately return correct info.

smesser

  • Posts: 122
Re: BASSmix beta (mixing & resampling add-on)
« Reply #33 on: 11 Nov '05 - 15:15 »
Can this add-on be used for cross-fading between tracks?

radio42

  • Posts: 4574
Re: BASSmix beta (mixing & resampling add-on)
« Reply #34 on: 11 Nov '05 - 15:21 »
Yes it can...

Create a new mixer stream at 44kHz, stereo using floats - out of two source streams:
Code: [Select]
// this will be the final mixer output stream being played
int mixerStream = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSStream.BASS_SAMPLE_FLOAT );
// now we need some channels to plug them in...create two decoding sources
int streamA = Bass.BASS_StreamCreateFile("testA.mp3", 0, 0, BASSStream.BASS_STREAM_DECODE | BASSStream.BASS_SAMPLE_FLOAT);
int streamB = Bass.BASS_StreamCreateFile("testB.mp3", 0, 0, BASSStream.BASS_STREAM_DECODE | BASSStream.BASS_SAMPLE_FLOAT);
// finally we plug them into the mixer (just to be sure, we use the downmix option to stereo)
bool okA = BassMix.BASS_Mixer_StreamAddChannel(mixerStream, streamA, (int)BASSStream.BASS_MIXER_DOWNMIX);
bool okB = BassMix.BASS_Mixer_StreamAddChannel(mixerStream, streamB, (int)BASSStream.BASS_MIXER_DOWNMIX);
// and play it...
Bass.BASS_ChannelPlay(mixerStream, false);
Start mixing:
Code: [Select]
// set streamB to silent
Bass.BASS_ChannelSetAttributes(streamB, -1, 0, -101);
// start fading out streamA for 3sec.
Bass.BASS_ChannelSlideAttributes(streamA, -1, -2, -101, 3000);
// start fading int streamB for 3sec.
Bass.BASS_ChannelSlideAttributes(streamB, -1, 100, -101, 3000);

smesser

  • Posts: 122
Re: BASSmix beta (mixing & resampling add-on)
« Reply #35 on: 11 Nov '05 - 16:43 »
Cool, Thanks

Your\'s fgerfr

  • Guest
Re: BASSmix beta (mixing & resampling add-on)
« Reply #36 on: 12 Nov '05 - 02:33 »
Great job, Ian!  :) Is working!  :D Now I'm happy!  :D Try out, guys, this super song (pb_static.xm) as quadraphonic with new Bass add-on BassMix!  :D

http://www.modarchive.com/cgi-bin/download.cgi/P/pb_static.xm
http://www.modarchive.com/artists/mrstewe/

Ian, BassMix does not support BASS_SAMPLE_LOOP flag? Is so, can You make it avalaible for us as You included BASS_STREAM_AUTOFREE flag?

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #37 on: 13 Nov '05 - 14:15 »
Looping is supported, by setting the BASS_SAMPLE_LOOP flag on the source channel :)

Your's fgerfr

  • Guest
Re: BASSmix beta (mixing & resampling add-on)
« Reply #38 on: 14 Nov '05 - 15:56 »
Perfect!  :) Thanks.  ;)

Looping is supported, by setting the BASS_SAMPLE_LOOP flag on the source channel :)

jpierson

  • Posts: 2
Re: BASSmix beta (mixing & resampling add-on)
« Reply #39 on: 6 Dec '05 - 04:40 »
I just downloaded BASS this evening, so I may be missing something here...

Does BASSmix support DSP's?   I plugged in a WinAmp DSP to the source channel and that works great,  but when I attempted to plug in a WinAmp DSP to the BASSMix channel... no luck. 

Being able to apply processing to the output of the mixer is critical to the project I'm working on right now.


radio42

  • Posts: 4574
Re: BASSmix beta (mixing & resampling add-on)
« Reply #40 on: 6 Dec '05 - 11:40 »
Just tested it - it works fine!
So you can assign a Winamp DSP to the mixer channel - yepp!
-> So what error do you get?

Here is a little code snippet :

Code: [Select]
private int _winampDSP;
...
// at startup - just as an example
if ( Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, 0, null) )
{
    BassWa.BASS_WADSP_Init(this.Handle);
    _winampDSP = BassWa.BASS_WADSP_Load( "dsp_ss131b.dll", 5, 5, 100, 100, null);
    BassWa.BASS_WADSP_Start(_winampDSP, 0, 0);
}
...
// mixer setup
_streamA = Bass.BASS_StreamCreateFile(_fileNameA, 0, 0, BASSStream.BASS_STREAM_DECODE);
_streamB = Bass.BASS_StreamCreateFile(_fileNameB, 0, 0, BASSStream.BASS_STREAM_DECODE);
// this will be the final mixer output stream being played
_mixerStream = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSStream.BASS_STREAM_AUTOFREE );
// add a Winamp DSP here
BassWa.BASS_WADSP_ChannelSetDSP(_winampDSP, _mixerStream, 1);
// and play it
Bass.BASS_ChannelPlay(_mixerStream, false);
...
// and finally at the end of your app, free all
Bass.BASS_Stop();
Bass.BASS_Free();
BassWa.BASS_WADSP_Free();

jpierson

  • Posts: 2
Re: BASSmix beta (mixing & resampling add-on)
« Reply #41 on: 7 Dec '05 - 04:55 »
I just downloaded BASS this evening, so I may be missing something here...

Does BASSmix support DSP's?   I plugged in a WinAmp DSP to the source channel and that works great,  but when I attempted to plug in a WinAmp DSP to the BASSMix channel... no luck. 

Being able to apply processing to the output of the mixer is critical to the project I'm working on right now.



Thanks.....    I knew I was missing something....   I wasn't paying attention to the BASSStream flags - got to have BASS_STREAM_DECODE on the stream.



Niels

  • Posts: 4
Re: BASSmix beta (mixing & resampling add-on)
« Reply #42 on: 26 Dec '05 - 13:18 »
Great addon!

Is it possible to plug streamB in, when streamA is on a specified position?

I try'd to plug streamA in to mixerStream, then set the mixerStream's position to 5 seconds (using the BASS_ChannelSeconds2Bytes function) and than plugged in streamB.. But it seems that the position functions won't work for that..

When i only plug streamA on and than try to change the position using the BASS_Mixer_ChannelSetPosition function (both before and after the ChannelPlay command), it won't work.

Maybe it is a good idea to add a parameter to BASS_Mixer_StreamAddChannel to specify the position in mixerStream where to add streamB?

That would be great. Then you can create a sequence of audio and mix it all down to 1 audiofile.

3delite

  • Posts: 895
Re: BASSmix beta (mixing & resampling add-on)
« Reply #43 on: 26 Dec '05 - 15:46 »
I try'd to plug streamA in to mixerStream, then set the mixerStream's position to 5 seconds (using the BASS_ChannelSeconds2Bytes function) and than plugged in streamB.. But it seems that the position functions won't work for that..

Are you sure of that?
You are setting position with:
Code: [Select]
BASS_ChannelSetPosition(handle: DWORD; pos: QWORD);

You could use a SYNCPROC for that with BASS_SYNC_POS and plug in the stream in there!
Anyway maybe not a bad idea for the next release of bassmix!
 

Niels

  • Posts: 4
Re: BASSmix beta (mixing & resampling add-on)
« Reply #44 on: 26 Dec '05 - 16:30 »
Are you sure of that?
You are setting position with:
Code: [Select]
BASS_ChannelSetPosition(handle: DWORD; pos: QWORD);
Yes i do, but position is in bytes, so i use BASS_ChannelSeconds2Bytes to convert seconds to bytes
Code: [Select]
Bass.BASS_ChannelSetPosition(mixerStream, Bass.BASS_ChannelSeconds2Bytes(mixerStream, 5));
Both mixerStream or streamA doesnt work

Niels

  • Posts: 4
Re: BASSmix beta (mixing & resampling add-on)
« Reply #45 on: 27 Dec '05 - 11:56 »
That would be great. Then you can create a sequence of audio and mix it all down to 1 audiofile.
Hmm i'm thinking about that.. it would be totally great if there is a function like 'RegionCreate'.. where you can store just a piece of audio from a stream in.

Something like BASS_RegionCreate(stream, startposition, endposition)

And then plug that regions in the mixerStream. Then you can cut the audio pieces you want, and mix them together to one file..

Maybe this goes a little bit far, but i think it's a great idea (e.g. for sequencers/multitrack applications) ? :)

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #46 on: 28 Dec '05 - 13:39 »
Is it possible to plug streamB in, when streamA is on a specified position?

I try'd to plug streamA in to mixerStream, then set the mixerStream's position to 5 seconds (using the BASS_ChannelSeconds2Bytes function) and than plugged in streamB.. But it seems that the position functions won't work for that..

When i only plug streamA on and than try to change the position using the BASS_Mixer_ChannelSetPosition function (both before and after the ChannelPlay command), it won't work.

Seeking in mixer streams isn't feasible. For example, if the mixer has a custom stream source, how's it gonna seek that? :)

Try setting a mixtime POS sync (BASS_SYNC_POS|BASS_SYNC_MIXTIME) on the mixer, at the position you want streamB to start, and then add streamB to the mixer in the SYNCPROC callback.

Maybe it is a good idea to add a parameter to BASS_Mixer_StreamAddChannel to specify the position in mixerStream where to add streamB?

That may be a possibility. I'll have to look into it.

ryswick

  • Posts: 1
Re: BASSmix beta (mixing & resampling add-on)
« Reply #47 on: 30 Dec '05 - 12:42 »
why is it that the file is corrupted.i only got the bassmix.bas in the vb folder.  and the dll's ver. is 0.0.0.0?

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #48 on: 30 Dec '05 - 17:59 »
There are currently no examples included, but hopefully you can see how to use BASSmix from the documentation and the posts in this thread.

Ian @ un4seen

  • Administrator
  • Posts: 20396
Re: BASSmix beta (mixing & resampling add-on)
« Reply #49 on: 27 Feb '06 - 16:36 »
An update is in the BASSmix download.

A new BASS_Mixer_StreamAddChannelEx function has been added, which allows a channel to be delayed and it's duration to be limited, ie. setting start and end points for the channel in the mix. A mixer's playback buffer can also be flushed now, using BASS_ChannelPlay (restart=TRUE).

This is still a beta release, so please report any problems you encounter.