Welcome to %s forums

BrainModular Users Forum

Login Register

A very simple problem about sending constants

I need help on a Patch
Post Reply
oxyredox
Member
Posts: 44
Location: Paris
Contact:

Unread post by oxyredox » 16 Jun 2009, 21:39

HI, it may seem quite simple (it would'nt be a problem for me in Max) but I can't solve it today, so here's another newbie problem :

CONTEXT :
I'm using USINE to manage several virtual instruments, and all the program changes. So there's one track per instrument (let's say 1: pianoteq, 2: kontact, 3: some modular synth) plus one track with a patch that manages program changes ofr the first 3 tracks. So I have one data bus per instrument.

PROBLEM :
In the program manager patch, I need one button per song which would send an integer in each data bus.
There comes my problem :
the button only sends a quick sequence {1,0} and I don't know what to do with it. I know the "constant" module but it doesn't have a trigger inlet. PLUS the "1 to 0" or "0 to 1" module, (from which I expected a simple 1 I could then multipliy by whatever constant I need) always send {1,0} (in other words it doesn't work when put after a button)

Has anyone a simple way of dealing with it ? just sending 36 or 67 in a data bus without moving a fader or a knob ?

thanks

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 16 Jun 2009, 21:45

hi oxyredox, a swich send constant 0 or 1, a button short impule 1,then 0, you can set a constant module to a desired values, but then you should multiply the output of the swich or button with an AxB module (no need constant, enter value in a or B, the other is the sw or button)). the ouput will be then ie 36x1 when on so 36, 0 when off 36x0. the 0 to 1 creates a short impulse ie when a swich goes from 0 to 1, the 1 to 0 when the swich (any1/0 type) goes from 1 to 0.
from what i undestand you're after, you could also have a look at the dispacher module in data, it will let you enter up to 16 values and with a selector you choose what value to send to the output.
hope it helps.

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 16 Jun 2009, 21:54

hello and welcome !
try to link your button to the inlet pass of a " pass event flow "module ( module/event control )
then set the inlet " in" to whatever value you want ( it's keep his value )

hope this help

grego mondo
Member
Posts: 466
Location: 22110 Rostrenen
Contact:

Unread post by grego mondo » 16 Jun 2009, 22:15

You're both so quick "human" people don't have time to answer (for once they could answer something ... )

I'd use the switch and "multiply" or the "pass even flow" way or a mapper way ...

a mapper value with the condutor for example
get the number of the scene from the conductor and then map it
(for example scene 1 = data 3 for track 1 / data 5 for track 2 / data 9 for track 3
and for scene 2 = data 7 for track 1 / data 2 for track 2 / data 4 for track 3)
one mapper per buse (wich means 3 mappers)
Mapper 1 (0=0, 1=3, 2=7) Mapper 2 (0=0, 1=5, 2=2) Mapper 3 (0=0, 1=9, 2=4).

Not sure it's the best way for your "problem" but it's always useful to see how other people would do ...

Hope it helps ...
En attendant cordialement l'apocalypse ... 100% Usine !!
https://lesformesdufond.kaz.bzh/grego-mondo/
PC i7 2.6Ghz - Win11 / RME Fireface UFX
Tubas / Serpent / Music Box
Interfaces Midi / OSC / DMX

oxyredox
Member
Posts: 44
Location: Paris
Contact:

Unread post by oxyredox » 17 Jun 2009, 09:51

thanks
you guys are both quick and precise. (and helpful, that makes up 3)


23fx23 : thanks to your tip I've played a bit around with the dispatcher module and I'll remember it form now on. Yet since it only routes data, I have the same problem as before, but ahead of the dispatcher : have a single button send my single integer. Anyway, I was glad to learn that the "0to1" and "1to0" modules send impulses and not just 1 as it says in the documentation !!
My first idea was to multiply the output of the button, but it always ends with 0... so I always end with program 1...:)


nay-seven : I think your way is the most simple : it works and only takes 2 small modules. So I'll stick to "pass event flow" and a "button". thank U.


grego mondo : your idea with scenes and mapper is really intertesting.
"Not sure it's the best way for your "problem" but it's always useful to see how other people would do ..."
I do totally agree!

ok, now I can go back to work...

Clearscreen
Member
Posts: 482
Location: Australia
Contact:

Unread post by Clearscreen » 18 Jun 2009, 01:49

maybe use a multi variable module (from maths modules)? when you trigger the input a set value is sent. if you want different on/off values use some A=B modules so that when the switch equals 1 you get a different value to when the switch equals 0.

as far as this goes:
My first idea was to multiply the output of the button, but it always ends with 0... so I always end with program 1..
try using a switch instead of a button - a switch operates as a toggle and a button is an impulse only.

if you want to get more/less complicated you could also use arrays for this i think...

oxyredox
Member
Posts: 44
Location: Paris
Contact:

Unread post by oxyredox » 18 Jun 2009, 22:03

Thanks for you suggestion Clearscreen,

I'll try this one as well !

but now I have a more subtle question. It obviously seems that if I want to send several [ "button"-"pass event flow"] modules to the same bus, I'm not allowed to create several "send to bus" objects feeding the same bus. Cos if so, the bus remains stucked with the first "send to bus" object having fed him. So I have to create only one "send to bus" and link it to everyone.

Can you confirm this, or is it a side effect of a big mistake I was'nt aware of ? !)

thanks for sharing your knowledge.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 19 Jun 2009, 00:02

yes, that's it, in fact this way you send them all to the same bus. once you press pass, the new value is sent.
..but checked you're right the pass doesn' work with busses if they re different, even with same name, (as would espect?) work with classical outputs or bus should be the same.

another way is using AxB modules to multiply the data by the buttons, send them to bus (so you can use differents but same label)
then on the other side you will receive always 0 or a value when press, so you can make a "pass if positive" using an A>B to check if the bus is positive, then the value pass (pass module, link the A>B out to the "pass"inlet) but if you need to sometimes send 0 this won't work, then you can collect all the buttons out (not values) to a send bus that will be used to feed the pass.

there must be tons of others ways also..

edit mm checked even my tec doesn't work, very strange I figured same named bus would act as one also..
maybe work if in two diferents sub pachs, if in the same should use only one named bus? have to check.
edit nope, enlightments?

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

Unread post by bsork » 21 Jun 2009, 22:55

IIRC, Senso mentioned in a topic some weeks ago that a new send bus using an existing name will override the old one, but perhaps it's the way Oxyredox describes it; that only the first one works(?). I haven't tested it myself though, I mostly use buses the other way around, ie to distribute data, not collect them.

If you want to send several buttons or whatever to other patches via busses, the best thing to do would IMO either to have separate send and receives busses for each value, or (my preferred method for data related data), connect the separate values
to different elements of an array, and retrieve the data using another array module in the receiveing patch(es).
Bjørn S

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 21 Jun 2009, 23:03

connect the separate values
to different elements of an array, and retrieve the data using another array module in the receiving patch(es).
...hum...interesting !
can you develop /illustrate this..bsork..?
please..;-)

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 22 Jun 2009, 01:38

I do this for collecting main parameters for preset , i think bsork mean on an array display/set you can have 16 inputs, you can drive several inputs (ie a fader, a list box,ect to the array separate inputs , then you send the whole array out to a bus, and on the otherside the same named bus get the array, so if putting again an array display/setcan demultiplex the 16 values.
there are many workaround for the bus pb, but if let's say we have 5 different subpach in very differents part of a patch, that should send to a same bus, that need to make 5 different named bus, and later collect the 5 bus, or do that array trick,or use normal wires,, the logical and more handy way would be to send them all locally to an "A" bus and if we get "A" should have the sum of 5...i think that's what oxyredox refered to. I agree, not drastic, just hope may work like this one day if senso can find a solution...
now I remember senso spoke about this, seems hard to achieve sadly, otherwise the busses are very powefull, to be able to change buss names dynamically is really awesome, and that work very well in other side that's true, having several "get" buss with same name work like a charm and avoid many wires, just need to be organised on syntax :)

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

Unread post by bsork » 22 Jun 2009, 08:17

I think 23fx23 filled in the blanks of my post nicely. I only want to add that you don't have to stick with the first 16 array elements that have separate in-/outputs on the modules. You can use get/set array element, concat arrays, extract sub array etc to set and retrieve up to 512 values in one array.
Bjørn S

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 22 Jun 2009, 08:28

thanks guys ! gone to try it this evening ( this is a good candidate for Utils compilations v2...;-) )

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests