22 May '13 - 14:10 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Mixing one stereo file into 6 mono streams. Possible?  (Read 1234 times)
A440hz
Posts: 6


« on: 13 May '10 - 12:21 »
Reply with quoteQuote

Hi,

Love Bass! I use it to playback 6 mono files into a 5.1 surround channel assignment.

I don't know anything about BASSMix. Using it and BASS, would it be possible to take a single stereo file and mix it to 6 independent mono streams that could then be assigned to a 5.1 layout? I'd need to invert the phase differently on either channel in all stereo to mono mixes. Ideally, I would like to do this all in a buffer and on multiple files from a playlist.

Thanks,
Joe
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 13 May '10 - 16:45 »
Reply with quoteQuote

Do you just want to rearrange/invert the 6 channels? If so, BASSmix's matrix mixing feature could be used for that. If you want to actually split a 6 channel source into 6 separate streams, then BASSmix's "splitter" feature could be used to do that. Please see the BASSmix documentation for details on both.
Logged
A440hz
Posts: 6


« Reply #2 on: 14 May '10 - 12:36 »
Reply with quoteQuote

Thanks Ian!

I want to invert one of the stereo channels in different percentages. Am I right in assuming the following would work?

HSTREAM mixer=BASS_Mixer_StreamCreate(44100, 2, 0); // create a stereo mixer

HSTREAM source1=BASS_StreamCreateFile(FALSE, file1, 0, 0, BASS_STREAM_DECODE); // open 1st source file
BASS_Mixer_StreamAddChannel(mixer, source1, BASS_MIXER_MATRIX); // add it to the mix with matrix mixing enabled
float matrix[1][2]={
    {0.5, -0.5}, // mono out = left - right in   
};
BASS_Mixer_ChannelSetMatrix(source1, matrix); // apply the matrix

HSTREAM LFMIX=BASS_StreamCreate(44100,1,$BASS_SPEAKER_FRONTLEFT,mixer,0) // assign the mix to front left speaker

BASS_ChannePlay(LFMIX, FALSE); // play the mix

Thanks,
Joe
« Last Edit: 14 May '10 - 13:09 by A440hz » Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #3 on: 14 May '10 - 17:40 »
Reply with quoteQuote

The matrix looks fine, but the "LFMIX" stream stuff not so much. I'm not sure there is really any need for that, as you could set the BASS_SPEAKER_FRONTLEFT flag on the mixer itself and make it mono. The code could be modified to look like this...

HSTREAM mixer=BASS_Mixer_StreamCreate(44100, 1, BASS_SPEAKER_FRONTLEFT); // create a mono mixer on front left speaker

HSTREAM source1=BASS_StreamCreateFile(FALSE, file1, 0, 0, BASS_STREAM_DECODE); // open 1st source file
BASS_Mixer_StreamAddChannel(mixer, source1, BASS_MIXER_MATRIX); // add it to the mix with matrix mixing enabled
float matrix[1][2]={
    {0.5, -0.5}, // mono out = left - right in   
};
BASS_Mixer_ChannelSetMatrix(source1, matrix); // apply the matrix

BASS_ChannePlay(mixer, FALSE); // play the mix
Logged
A440hz
Posts: 6


« Reply #4 on: 14 May '10 - 17:58 »
Reply with quoteQuote

Thanks Ian! I'll test when I get home from work Smiley
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines