# how to make conditional output specific number?

I want to monitor the output of a conditional and when it goes from 0 to 1, I want to output a specific number. How do I do that?

Thanks!

## Comment viewing options

### Re: how to make conditional output specific number?

In signal processing, this is referred to as the "Rising Edge", as in, if you graphed the value over time, you want to do something on the upward edge (there's also "falling edge", and level-triggered, for other variations).

Anyway, to do this you'll want to use a Watcher patch, and then a Logic or Mathematical Expression patch to see when Watcher's output is true (the parameter has changed), /And/ the value is true (the /And/ is done via the Logic or Math Expression patch).

When the And of those two conditions is true, you've isolated a Rising edge, and you can use that to trigger whatever you want (whether it's an output number or an effect or something else).

### Re: how to make conditional output specific number?

I don't quite understand. I have a Conditional that is outputting 0 but when the condition is true, it is outputting a 1. (Essentially doing a boolean, right?). Anyway, when that conditional outputs a 1, I want to have that somehow output a 7 or 13 or whatever arbitrary number I choose so it can trigger a proper index value.

I don't understand how you are going from monitoring the output to actually creating a new value? What patch does that?

### Re: how to make conditional output specific number?

mathematical expression:

`x == 0 ? 42 : 84`

If x is 0, it will output 42; else, 84.

Alternatively, the Multiplexer -- use the 0/1 output to control the input index, and set each index to the value you're interested in.

### Re: how to make conditional output specific number?

Or - yet another way - you could use a math path and multiply the result of the conditional with your arbitrary number.

### Re: how to make conditional output specific number?

If you need to interpolate between values use the LFO, Interpolation or Timeline (or Smooth on a non interpolated output).

If you just need one to one mapping I'd say use a Multiplexer.

Then there are the maths based options, and javascript.

I've made a little composition here which shows different mapping techniques.

There is an example composition somewhere on this site which has a handy "map from between these two values to these two values" virtual macro... somewhere :P

PreviewAttachmentSize
Mapping Value Techniques.qtz32.2 KB

### Re: how to make conditional output specific number?

Thanks people for these responses.

I have found conditionals confusing as well.