Matrix Mixer problem
Matrix Mixer problem
- Subject: Matrix Mixer problem
- From: Ethan Funk <email@hidden>
- Date: Mon, 11 Oct 2004 12:58:39 -0700
I am having a bit of trouble setting MatrixMixer matrix volumes. It appears that only the first setting (input 0, output 0) get set as observed from my output device. I have 8 stereo input busses and a single 8 channel output bus. The procedure I am using (shown at the end of this message) to set the matrix volumes is based on apples example code, which looks simple enough. Any one have an idea what I am doing wrong?
Thanks,
Ethan...
Here is are the results from the procedure call below when I set up the first player.
Inputs 0 and 1 on matrix mixer bus #0, pNum = 0, player->bus_assignment = 5 (output channels 0,1,4,5), player->balance = 0:
IN=0 OUT=0 CROSS=00000000 VOL=1
IN=1 OUT=0 CROSS=00010000 VOL=0
IN=0 OUT=1 CROSS=00000001 VOL=0
IN=1 OUT=1 CROSS=00010001 VOL=1
IN=0 OUT=2 CROSS=00000002 VOL=0
IN=1 OUT=2 CROSS=00010002 VOL=0
IN=0 OUT=3 CROSS=00000003 VOL=0
IN=1 OUT=3 CROSS=00010003 VOL=0
IN=0 OUT=4 CROSS=00000004 VOL=1
IN=1 OUT=4 CROSS=00010004 VOL=0
IN=0 OUT=5 CROSS=00000005 VOL=0
IN=1 OUT=5 CROSS=00010005 VOL=1
IN=0 OUT=6 CROSS=00000006 VOL=0
IN=1 OUT=6 CROSS=00010006 VOL=0
IN=0 OUT=7 CROSS=00000007 VOL=0
IN=1 OUT=7 CROSS=00010007 VOL=0
void UpdateMatrix(UInt32 pNum)
{
int ic, oc, ob;
float bal[4]; // {inLoutL, inRoutL, inLoutR, inRoutR} balance matrix
float level;
ARPlayer *player;
UInt32 buses, crosspoint, mIn, mOut;
float balance, L, R;
pthread_mutex_lock( &pMutex );
if (player = pList[pNum]){
buses = player->bus_assignment;
balance = player->balance;
pthread_mutex_unlock( &pMutex );
}else{
pthread_mutex_unlock( &pMutex );
return;
}
L = sqrt(1.0 + balance);
R = sqrt(1.0 - balance);
bal[0] = L;
bal[1] = 0.0;
bal[2] = 0.0;
bal[3] = R;
if (buses < 0){
//we are in cue mode!
buses = 2L; // bus 1 (cue) only
}
0; ob < outChNum/inChNum; ob++){
0; oc < inChNum; oc++){
0; ic < inChNum; ic++){
level = (1L & (buses >> ob)) * bal[(oc * inChNum) + ic];
mIn = (inChNum * pNum) + ic;
mOut = (inChNum * ob) + oc;
crosspoint = (mIn << 16) | (mOut & 0x0000FFFF);
fprintf(stdout, "IN=%lu OUT=%lu CROSS=X VOL=%g\n", mIn, mOut, crosspoint, level);
AudioUnitSetParameter( mixer,
kMatrixMixerParam_Volume,
kAudioUnitScope_Global,
crosspoint,
level,
0);
}
}
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden