make bang when change happens

onoxo's icon

Hi all!
(This is my firs post here)

I'm building a sequencer that should control VST plugin (Battery) via "vst~" object. So far i've figure out some basic concepts to create this kind of patch, but right now i'm stuck with making "bang" signal after some change in "tempo" object.

Here is the detailed description of the problem. I want to make a bang in every change that comes from tempo object and send it to vst midievent when certain condition is meet in "if then" object.

The example patch is in att.

Vedran

1334.test_battery_2.maxpat
Max Patch
MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

your problem is the {if $1 && $2 == 1 then $i1]. "&&" is the logical AND operator. So what you are asking is "if the first number AND the second number are equal to 1, give me the first number". Since the first number is between 1 and 8, the only time you would ever get any output is if the first toggle is on and your counter is at 1.
Have a look below. It's one way of doing it. I also changed your [pack] to a [pak] so that every change outputs the list (no need for the bang anymore).

Luke Hall's icon

Just to clear things up a little: [if $i1 && $i2 == 1 then $i1] means if the value in the first inlet is non-zero and the value in the second inlet is equal to 1 then outlet the first value. To be as MIB describes it would need to be [if $i1 == 1 && $i2 == 1 then £i1].

if $i1 is a boolean operation with 0 being false and anything else being true. You need to be specific either side of the == operator if you want to compare both inlet values.

I hope that clears things up a tiny bit.

lh

MIB's icon

@Luke - silly me. should think a bit longer before posting.