desktopmix

Desktop mixer core to be controlled with the desktop mixer controllers features external pan, volume, aux-destination and aux-sendLevel controls for 8 channels.
Author: Remco van der Most
License: BSD
Github: sss/mix/desktopmix.axo

Inlets

frac32buffer audio1

frac32buffer audio2

frac32buffer audio3

frac32buffer audio4

frac32buffer audio5

frac32buffer audio6

frac32buffer audio7

frac32buffer audio8

frac32buffer returnL

frac32buffer returnR

frac32.bipolar volume1

frac32.bipolar volume2

frac32.bipolar volume3

frac32.bipolar volume4

frac32.bipolar volume5

frac32.bipolar volume6

frac32.bipolar volume7

frac32.bipolar volume8

frac32.bipolar sendVol1

frac32.bipolar sendVol2

frac32.bipolar sendVol3

frac32.bipolar sendVol4

frac32.bipolar sendVol5

frac32.bipolar sendVol6

frac32.bipolar sendVol7

frac32.bipolar sendVol8

frac32.positive pan1

frac32.positive pan2

frac32.positive pan3

frac32.positive pan4

frac32.positive pan5

frac32.positive pan6

frac32.positive pan7

frac32.positive pan8

int32.positive aux1

int32.positive aux2

int32.positive aux3

int32.positive aux4

int32.positive aux5

int32.positive aux6

int32.positive aux7

int32.positive aux8

Outlets

frac32 peak1

frac32 peak2

frac32 peak3

frac32 peak4

frac32 peak5

frac32 peak6

frac32 peak7

frac32 peak8

frac32 peakL

frac32 peakR

frac32buffer outL

frac32buffer outR

frac32buffer aux1

frac32buffer aux2

frac32buffer aux3

frac32buffer aux4

frac32buffer aux5

frac32buffer aux6

frac32buffer aux7

frac32buffer aux8

Parameters

frac32.u.map MainVol

Declaration
int32_t aux[8];
int32_t peak0;
int32_t peak1;
int32_t peak2;
int32_t peak3;
int32_t peak4;
int32_t peak5;
int32_t peak6;
int32_t peak7;
int32_t peak8;
int32_t peak9;
int32_t peaka0;
int32_t peaka1;
int32_t peaka2;
int32_t peaka3;
int32_t peaka4;
int32_t peaka5;
int32_t peaka6;
int32_t peaka7;
int32_t peaka8;
int32_t peaka9;
Control Rate
int32_t pan1L;
int32_t pan1R;
int32_t vol1;
vol1 = inlet_volume1;
pan1L = ___SMMUL(((1 << 27) - inlet_pan1) << 3, vol1 << 2) << 1;
pan1R = ___SMMUL((inlet_pan1) << 3, vol1 << 2) << 1;

int32_t pan2L;
int32_t pan2R;
int32_t vol2;
vol2 = inlet_volume2;
pan2L = ___SMMUL(((1 << 27) - inlet_pan2) << 3, vol2 << 2) << 1;
pan2R = ___SMMUL((inlet_pan2) << 3, vol2 << 2) << 1;

int32_t pan3L;
int32_t pan3R;
int32_t vol3;
vol3 = inlet_volume3;
pan3L = ___SMMUL(((1 << 27) - inlet_pan3) << 3, vol3 << 2) << 1;
pan3R = ___SMMUL((inlet_pan3) << 3, vol3 << 2) << 1;

int32_t pan4L;
int32_t pan4R;
int32_t vol4;
vol4 = inlet_volume4;
pan4L = ___SMMUL(((1 << 27) - inlet_pan4) << 3, vol4 << 2) << 1;
pan4R = ___SMMUL((inlet_pan4) << 3, vol4 << 2) << 1;

int32_t pan5L;
int32_t pan5R;
int32_t vol5;
vol5 = inlet_volume5;
pan5L = ___SMMUL(((1 << 27) - inlet_pan5) << 3, vol5 << 2) << 1;
pan5R = ___SMMUL((inlet_pan5) << 3, vol5 << 2) << 1;

int32_t pan6L;
int32_t pan6R;
int32_t vol6;
vol6 = inlet_volume6;
pan6L = ___SMMUL(((1 << 27) - inlet_pan6) << 3, vol6 << 2) << 1;
pan6R = ___SMMUL((inlet_pan6) << 3, vol6 << 2) << 1;

int32_t pan7L;
int32_t pan7R;
int32_t vol7;
vol7 = inlet_volume7;
pan7L = ___SMMUL(((1 << 27) - inlet_pan7) << 3, vol7 << 2) << 1;
pan7R = ___SMMUL((inlet_pan7) << 3, vol7 << 2) << 1;

int32_t pan8L;
int32_t pan8R;
int32_t vol8;
vol8 = inlet_volume8;
pan8L = ___SMMUL(((1 << 27) - inlet_pan8) << 3, vol8 << 2) << 1;
pan8R = ___SMMUL((inlet_pan8) << 3, vol8 << 2) << 1;

peak1 = peak1 > 0 ? peak1 : -peak1;
peak2 = peak2 > 0 ? peak2 : -peak2;
peak3 = peak3 > 0 ? peak3 : -peak3;
peak4 = peak4 > 0 ? peak4 : -peak4;
peak5 = peak5 > 0 ? peak5 : -peak5;
peak6 = peak6 > 0 ? peak6 : -peak6;
peak7 = peak7 > 0 ? peak7 : -peak7;
peak8 = peak8 > 0 ? peak8 : -peak8;
peak0 = peak0 > 0 ? peak0 : -peak0;
peak9 = peak9 > 0 ? peak9 : -peak9;

if (peak1 > peaka1) {
  peaka1 = peak1;
} else {
  peaka1 = peaka1 + ((peak1 - peaka1) >> 4);
}

if (peak2 > peaka2) {
  peaka2 = peak2;
} else {
  peaka2 = peaka2 + ((peak2 - peaka2) >> 4);
}

if (peak3 > peaka3) {
  peaka3 = peak3;
} else {
  peaka3 = peaka3 + ((peak3 - peaka3) >> 4);
}

if (peak4 > peaka4) {
  peaka4 = peak4;
} else {
  peaka4 = peaka4 + ((peak4 - peaka4) >> 4);
}

if (peak5 > peaka5) {
  peaka5 = peak5;
} else {
  peaka5 = peaka5 + ((peak5 - peaka5) >> 4);
}

if (peak6 > peaka6) {
  peaka6 = peak6;
} else {
  peaka6 = peaka6 + ((peak6 - peaka6) >> 4);
}

if (peak7 > peaka7) {
  peaka7 = peak7;
} else {
  peaka7 = peaka7 + ((peak7 - peaka7) >> 4);
}

if (peak8 > peaka8) {
  peaka8 = peak8;
} else {
  peaka8 = peaka8 + ((peak8 - peaka8) >> 4);
}

if (peak0 > peaka0) {
  peaka0 = peak0;
} else {
  peaka0 = peaka0 + ((peak0 - peaka0) >> 4);
}

if (peak9 > peaka9) {
  peaka9 = peak9;
} else {
  peaka9 = peaka9 + ((peak9 - peaka9) >> 4);
}

outlet_peak1 = ___SMMUL(peaka1 << 3, inlet_volume1 << 2);
outlet_peak2 = ___SMMUL(peaka2 << 3, inlet_volume2 << 2);
outlet_peak3 = ___SMMUL(peaka3 << 3, inlet_volume3 << 2);
outlet_peak4 = ___SMMUL(peaka4 << 3, inlet_volume4 << 2);
outlet_peak5 = ___SMMUL(peaka5 << 3, inlet_volume5 << 2);
outlet_peak6 = ___SMMUL(peaka6 << 3, inlet_volume6 << 2);
outlet_peak7 = ___SMMUL(peaka7 << 3, inlet_volume7 << 2);
outlet_peak8 = ___SMMUL(peaka8 << 3, inlet_volume8 << 2);
outlet_peakL = peaka0;
outlet_peakR = peaka9;
Audio Rate
int32_t sumL;
int32_t sumR;
sumL = 0;
sumR = 0;
for (int i = 0; i < 8; i++) {
  aux[i] = 0;
}

if (inlet_aux1 > 0) {
  aux[inlet_aux1 - 1] = ___SMMUL(inlet_audio1 << 3, inlet_sendVol1 << 2);
}
sumL += ___SMMUL(inlet_audio1 << 3, pan1L << 2);
sumR += ___SMMUL(inlet_audio1 << 3, pan1R << 2);

if (inlet_aux2 > 0) {
  aux[inlet_aux2 - 1] = ___SMMUL(inlet_audio2 << 3, inlet_sendVol2 << 2);
}
sumL += ___SMMUL(inlet_audio2 << 3, pan2L << 2);
sumR += ___SMMUL(inlet_audio2 << 3, pan2R << 2);

if (inlet_aux3 > 0) {
  aux[inlet_aux3 - 1] = ___SMMUL(inlet_audio3 << 3, inlet_sendVol3 << 2);
}
sumL += ___SMMUL(inlet_audio3 << 3, pan3L << 2);
sumR += ___SMMUL(inlet_audio3 << 3, pan3R << 2);

if (inlet_aux4 > 0) {
  aux[inlet_aux4 - 1] = ___SMMUL(inlet_audio4 << 3, inlet_sendVol4 << 2);
}
sumL += ___SMMUL(inlet_audio4 << 3, pan4L << 2);
sumR += ___SMMUL(inlet_audio4 << 3, pan4R << 2);

if (inlet_aux5 > 0) {
  aux[inlet_aux5 - 1] = ___SMMUL(inlet_audio5 << 3, inlet_sendVol5 << 2);
}
sumL += ___SMMUL(inlet_audio5 << 3, pan5L << 2);
sumR += ___SMMUL(inlet_audio5 << 3, pan5R << 2);

if (inlet_aux6 > 0) {
  aux[inlet_aux6 - 1] = ___SMMUL(inlet_audio6 << 3, inlet_sendVol6 << 2);
}
sumL += ___SMMUL(inlet_audio6 << 3, pan6L << 2);
sumR += ___SMMUL(inlet_audio6 << 3, pan6R << 2);

if (inlet_aux7 > 0) {
  aux[inlet_aux7 - 1] = ___SMMUL(inlet_audio7 << 3, inlet_sendVol7 << 2);
}
sumL += ___SMMUL(inlet_audio7 << 3, pan7L << 2);
sumR += ___SMMUL(inlet_audio7 << 3, pan7R << 2);

if (inlet_aux8 > 0) {
  aux[inlet_aux8 - 1] = ___SMMUL(inlet_audio8 << 3, inlet_sendVol8 << 2);
}
sumL += ___SMMUL(inlet_audio8 << 3, pan8L << 2) + inlet_returnL;
sumR += ___SMMUL(inlet_audio8 << 3, pan8R << 2) + inlet_returnR;

if (inlet_aux1 > 0) {
  aux[inlet_aux1 - 1] = ___SMMUL(inlet_audio1 << 3, inlet_sendVol1 << 2);
}
outlet_outL = ___SMMUL(sumL << 3, param_MainVol << 2);
outlet_outR = ___SMMUL(sumR << 3, param_MainVol << 2);

peak1 = inlet_audio1;
peak2 = inlet_audio2;
peak3 = inlet_audio3;
peak4 = inlet_audio4;
peak5 = inlet_audio5;
peak6 = inlet_audio6;
peak7 = inlet_audio7;
peak8 = inlet_audio8;
peak0 = outlet_outL;
peak9 = outlet_outR;

outlet_aux1 = aux[0];
outlet_aux2 = aux[1];
outlet_aux3 = aux[2];
outlet_aux4 = aux[3];
outlet_aux5 = aux[4];
outlet_aux6 = aux[5];
outlet_aux7 = aux[6];
outlet_aux8 = aux[7];

Privacy

© 2024 Zrna Research