Welcome to %s forums

BrainModular Users Forum

Login Register

Solo/mute patch

I need help on a Patch
Post Reply
moody33
Member
Posts: 338
Contact:

Unread post by moody33 » 21 Nov 2007, 14:19

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.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 21 Nov 2007, 19:48

Unfortunately, it's not so easy...
The best way to create a solo switch is to make a small script!
Any candidate?

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 21 Nov 2007, 19:51

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


moody33
Member
Posts: 338
Contact:

Unread post by moody33 » 21 Nov 2007, 20:23

Ok !

I don't understand scripting ..so pleaseeeeee a candidate !

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 21 Nov 2007, 21:45

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...
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 22 Nov 2007, 09:51

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

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 22 Nov 2007, 10:31

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.
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 22 Nov 2007, 11:02

fascinating.
it's still hard sometimes to figure out when to go for scripting and when to stick to module-building.
:)

antwan

moody33
Member
Posts: 338
Contact:

Unread post by moody33 » 22 Nov 2007, 11:10

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.

moody33
Member
Posts: 338
Contact:

Unread post by moody33 » 22 Nov 2007, 11:22

Thanks you bsork ! It works perfectly !

moody33
Member
Posts: 338
Contact:

Unread post by moody33 » 22 Nov 2007, 12:28

If you want Mutes button, add Mute switches connected to MultipleVar.in 1 for each one.
I think it works.

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 22 Nov 2007, 14:51

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.
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 14 Jan 2008, 19:37

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

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 15 Jan 2008, 09:57

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?
Bjørn S

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 10:11

can you send me the patch by mail?
I'll take a look
contact @ sensomusic.com

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 15 Jan 2008, 10:37

Mail sent.
Bjørn S

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 13:14

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 !)

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 15 Jan 2008, 13:54

thanks.

i'll give it a look - and possibly return to using a script :)

antwan

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 15 Jan 2008, 15:14

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.
Bjørn S

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 18:47

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.

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 15 Jan 2008, 21:36

Ok. What inputs? Only the ins, the affects, or both?
Bjørn S

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 21:37

all input!
thats why Usine is 20-30% faster

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests