Page 1 of 1
Posted: 21 Nov 2007, 14:19
by moody33
Anyone know how to build a kind of mixer? I need "solo" button that automatically mute other output. But I also need having several "solo" button activate. In fine, I just need a kind of Reason mixer. any idea?
thanks you.
Posted: 21 Nov 2007, 19:48
by senso
Unfortunately, it's not so easy...
The best way to create a solo switch is to make a small script!
Any candidate?
Posted: 21 Nov 2007, 19:51
by antwan
Funny you mention, one reason I'm learning scripting right now was to make something like this. I'm a silent candidate cause it might take me time

if someone more experienced is up for it, go right ahead!
antwan
Posted: 21 Nov 2007, 20:06
by senso
cool!
Posted: 21 Nov 2007, 20:23
by moody33
Ok !
I don't understand scripting ..so pleaseeeeee a candidate !
Posted: 21 Nov 2007, 21:45
by bsork
Here's a script you can try out:
Code: Select all
VAR pIn : ARRAY OF TParameter;
VAR pOut : ARRAY OF TParameter;
VAR i : integer;
VAR bOn : BOOLEAN;
VAR tmp : ARRAY OF integer;
CONST NUM_CH = 8;
PROCEDURE init;
BEGIN
SetArrayLength(pIn, NUM_CH);
SetArrayLength(pOut, NUM_CH);
SetArrayLength(tmp, NUM_CH);
FOR i := 0 TO (NUM_CH - 1) DO BEGIN
pIn[i] := CreateParam('solo in'+IntToStr(i+1), ptSwitch);
SetIsOutput(pIn[i], FALSE);
END;
FOR i := 0 TO (NUM_CH - 1) DO BEGIN
pOut[i] := CreateParam('mute out'+IntToStr(i+1), ptSwitch);
SetIsInput(pOut[i], FALSE);
END;
END;
BEGIN
bOn := FALSE;
FOR i := 0 TO (NUM_CH - 1) DO BEGIN
tmp[i] := trunc(GetValue(pIn[i]));
IF (tmp[i] = 1) THEN
bOn := TRUE;
END;
IF (bOn) THEN BEGIN
FOR i := 0 TO (NUM_CH - 1) DO BEGIN
IF (tmp[i] = 1) THEN BEGIN
SetValue(pOut[i], 0);
END
ELSE BEGIN
SetValue(pOut[i], 1);
END;
END;
END
ELSE BEGIN
FOR i := 0 TO (NUM_CH - 1) DO
SetValue(pOut[i], 0);
END;
END.
I think it could have been a bit more compact and efficient, but I'm tired tonight...
Posted: 22 Nov 2007, 09:51
by antwan
thanks bsork,
looks good.
i'm looking into improving this script further so that:
- if some channel was muted before solo is activated, it will return to be muted after the solo is disactivated
- also so that several solos can be active at the same time (as moody33 mentioned)
i'll have to see how the solo/mute engines work generally in DAW-softwares but im pretty sure at least the functionalities mentioned above are valid...
i hope i'll have time today or tomorrow.
antwan
Posted: 22 Nov 2007, 10:31
by bsork
The script does allow for several solos to active at the same time; if 1 and 2 is soloed, 3 to 8 is muted, etc.
However, the script is a bit heavy on the CPU, so I've made the same functionality with modules:
First create a solo Switch, a mute Switch and a MultipleVar. Connect the solo Switch to MultipleVar.affect3, and the mute Switch to MultipleVar.out. Set MultipleVar.in2 = 1.
Select all three modules and copy them so that you have as many channels as you want.
Then create a A=B and a Not module. Connect all solo switches to A=B.A, and A=B.out to Not.in. Then connect A=B.out to affect1 and Not.out to affect2 on all MultipleVars. Voila - it wasn't so hard after all!
On my system the script uses around 5 times the CPU as this patch when running 8 channels.
Posted: 22 Nov 2007, 11:02
by antwan
fascinating.
it's still hard sometimes to figure out when to go for scripting and when to stick to module-building.
antwan
Posted: 22 Nov 2007, 11:10
by moody33
antwan wrote:i'm looking into improving this script further so that:
- if some channel was muted before solo is activated, it will return to be muted after the solo is disactivated
- also so that several solos can be active at the same time (as moody33 mentioned)
It's exactly what I want. Propellerhead Reason Mixer work like this if I remember.
Thanks everybody , I will try Bsork last suggestion.
Posted: 22 Nov 2007, 11:22
by moody33
Thanks you bsork ! It works perfectly !
Posted: 22 Nov 2007, 12:28
by moody33
If you want Mutes button, add Mute switches connected to MultipleVar.in 1 for each one.
I think it works.
Posted: 22 Nov 2007, 14:51
by bsork
antwan wrote:fascinating.
it's still hard sometimes to figure out when to go for scripting and when to stick to module-building.
antwan
In this case, I was "lucky" since the logic here can be expressed in 3 steps which fit the MultipleVar module perfect:
1) No solo? Don't mute
2) Solo? Mute, unless...
3) ...the corresponding solo button is on.
...and adding mute switches to MultipleVar.in1 works very well! Actually, I don't think all DAWs has that functionality - on some a muted channel will be unmuted after a solo.
Posted: 14 Jan 2008, 19:37
by antwan
Hi,
Strange, i opened this patch (made with the Multiple Vars) with the new version of Usine, hadn't used it for a while. And it seems it doesn't work now. When a Solo is pressed, it also Mutes the channel that was soloed. i.e. it mutes all channels regardless.
Any thoughts on what has changed?
antwan
Posted: 15 Jan 2008, 09:57
by bsork
I recreated the patch using my own "recipe" above creating 3 "channels", and experienced the same as you. However, if I deleted and recreated the connections between the Solo switches and MultipleVar.affect3 it worked ok.
Any comments, Olivier? Something wrong with copying several modules in one go, maybe?
Posted: 15 Jan 2008, 10:11
by senso
can you send me the patch by mail?
I'll take a look
contact @ sensomusic.com
Posted: 15 Jan 2008, 10:37
by bsork
Mail sent.
Posted: 15 Jan 2008, 13:14
by senso
ok I understand
If the previous patch was working it was only by "chance". I mean that the order of calculation was made for the patch to work but wasn't valid in the general case.
the problem is more complex than appears!
[mute1] is on when:
[solo2]=on OR [solo3]=on but only when [solo1]=off
in math domain it looks like:
mute1 = (solo2 OR solo3) and (not solo1)
mute2 = (solo1 OR solo3) and (not solo2)
mute3 = (solo1 OR solo2) and (not solo3)
so on the patch you only need OR, AND, NOT modules.
I've just posted an example in the add-ons section.
You see that the complexity grow with the number of buttons, and can be rapidly a nightmare.
So the script is a good candidate, with a constant to define the number of solo buttons (3,5 or 1764 !)
Posted: 15 Jan 2008, 13:54
by antwan
thanks.
i'll give it a look - and possibly return to using a script
antwan
Posted: 15 Jan 2008, 15:14
by bsork
I agree to some extent, but I also think the MultipleVar variety is just as valid logically, and I can't really understand why it wouldn't work. Well, never mind...
However, I couldn't resist to rethink a way of using modules without creating an over-complex patch when the number of involved channels increases. I also have put an example up in the add-ons; it uses Pass/Stop Event Flow modules and a single A>B. Within a reasonable amount of channels (up to 20? 30?), I guess this is better than using a script, at least CPU-wise.
Posted: 15 Jan 2008, 18:47
by senso
I understand it can be surprising!
In the new version of usine, the multiple var module is calculated only if it's input as changed. That why your patch doesn't work any more.
Posted: 15 Jan 2008, 21:36
by bsork
Ok. What inputs? Only the ins, the affects, or both?
Posted: 15 Jan 2008, 21:37
by senso
all input!
thats why Usine is 20-30% faster