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. ?
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?
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?
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.
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.
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
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.
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…
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
----------begin_max5_patcher---------- 704.3oc4XF0jZBCDG+Y7SQJO1pTRBfRmZ6zG6mgN2zAgbZ5.INRbTuaN+r2P BbZsJFOsQlouDLKKxe9kc2rvy8bbmvWSJcAeB7Cfiyy8bbTlpL3TO2wsHYcZ dRoxMWFYEexub6qOkfrVnL+tAaAPuFyrkETVNQntDTswG4LQI8IRkMHxyemu 7khFmg0V0lDalSzhysjNkkj6Bdn1g4IhzYT1zetfjJz9fi7k+q.ru9vnpQj7 2udMzLkVk5e.Zn6dxhkTntOteaAUdSpNwK85UMz+5vx62dmQRPnhEXMRPdgs fDzsEIo7hBBS7WLYFeEnLmuJeCHiC9NXJGH3.3WOJofWBo7OMHBvJPfBTf.h iaM3.ZORjyYS0bXUBUXGH.0P.haEB9VICQV2HH.JSY6D0NpQSDpMx.GZmviU yHLfXFsDTJR1TVkk3KG3pXFOOu+swJQpXEMVfCaGHQVIT4icqPEcojHXqjAY ExjlSmuE36cpsfw1lMCMIM5FWkU9TLgr30MbK3Yj8ebd6AKny.j9.2Gy4Ihc jQdhJWF3K2u8brROFGzJptw0hIOkkj1dqIlWnXjtDQn5fteipwi8bDeCWWQ2 u0UeuV3ANV2q0vvyutZmlPGOVVa3NWyTSilfjVqKD9+Qm406rhLH8OvJD4Ka qJX46C6DfQmEoaB4TbAaEt74pcVu6Xot2cMVBa+casBV9v3NRFjd+GLts2s0 vVMTWpaNkc32DQc6qr+mbpjubQZija5oArSAYjRAkkHnb1dNU8sG1yoYzrLB a+cYKnYy4TlnVDfGN5ploZ5fa2IzjLnA.sllLhSWHlvQwpP.csTb7tYWK.Q2 dwds7y2z0zKGfihT7KLnYx0pUSh+fH6xOSjjkWRMIJ6f7ltQXV2SRX6Vf0.E EX0xqXCUj8XTfIA2cNEEZUEEZHidqwQxIuz623EFteF -----------end_max5_patcher-----------
Forums > MaxMSP