--- On Wed, 11/3/10, Andy Farnell padawan12@obiwannabe.co.uk wrote:
From: Andy Farnell padawan12@obiwannabe.co.uk Subject: Re: [PD] Purpose of sig~ To: pd-list@iem.at Date: Wednesday, November 3, 2010, 5:14 PM There are some uses of [sig~] which are not immediately obvious but turn out to be desirable. By definition it is useful any place you want a message domain value converted to a signal, without any further ado. Without it, relying only on implicit conversion you might never have access to a signal except by a degenerate idiom like
[$1( | [line~]
Crucially, [sig~] can be given a creation parameter, as in [sig~ 1], and will not need any messy initialisation like using a [loadbang] in order to obtain a signal constant immediately.
Why might you want a signal constant? Perhaps for a relation like (1 - x), useful in panning, crossfading, or (1 / x) common in waveshaping.
Matju raises a question over DSP on/off. I have encountered problems relying on implicit right inlet conversion with deep abstractions, so from practical experience it seems safer to use [sig~] in these circumsatnces.
Is this because signal inlets of signal objects (except for the leftmost) don't accept one-element lists? If so I think it'd be a cheaper workaround putting a [t f] before those inlets.
It also make code more readable to make important message/signal distinctions explicit.
They are already explicit-- at least in pd-extended, where the signal inlets are visually distinct from the control inlets.
-Jonathan