simulated pull-up resistor (make a signal slowly gravitate toward toward 1.0)

Mar 23, 2011 at 11:00pm

simulated pull-up resistor (make a signal slowly gravitate toward toward 1.0)

I have an audio signal that i’m using to modulate other signals. Sometimes it goes dead, stopping at a value of 0.0 — when this happens, it silences the other signals, which is not what i want. How do i make it so that if the signal goes dead, it pulls back to a value of 1. instead of 0. ?

#55778
Mar 23, 2011 at 11:03pm

If it just fluctuates between 0 and 1, then you could just invert it [!-~ 1] … so when it goes “dead” it’s on 1 instead of 0. Would that work?

#200542
Mar 23, 2011 at 11:04pm

i guess i could use a snapshot~ and a counter and a crossfader, and crossfade to a signal of 1 whenever it counts to a certain number of 0 values in a row. But this seems like a really janky solution. Surely there’s a more elegant way?

#200543
Mar 23, 2011 at 11:06pm

Tim — that’s a cool idea, but the signal actually fluctuates between -1. and +1. I’d rather not have to do like a system-wide overhaul where i change all of the signal values.

#200544
Mar 23, 2011 at 11:09pm

I guess i could do a temporary downsample to take the signal to the 0-1 range, then invert it, then upsample it back to standard. but then i would lose some audio resolution, right?

edit: just realized this wouldn’t work at all; when upsampled the “dead” signal would sit at .5 instead of 0 or 1.

#200545
Mar 24, 2011 at 9:49am

i think i know what you mean … but this is not possible with a
“dead” signal, you have to make sure that you know at which sample
(or vector) the modulation signal goes back to “no modulation” (i.e. 1).

then you have to replace this signal with the desired steady signal for
“no mnodulation”.

i use two poly~n for this … one holding a [sig~ 1] and the other one
lets pass the signal which is comsing from the user control or LFO
or whatever. and when one is turned on – the other one is turned off.

#200546
Mar 24, 2011 at 3:27pm

What kind of modulation? If its amplitude modulation, just add a fixed value, and eventually scale it back.
In amplitude modulation you should avoid zero crossings anyway, as that would create a reversed phase…

Stefan

#200547
Mar 24, 2011 at 5:33pm

This is how I would do it…
According to what you use it for, you might want to smooth the jump back to the incoming value when it goes back to != 0
hth
aa

– Pasted Max Patch, click to expand. –
#200548

You must be logged in to reply to this topic.