Hi
Still a lot to learn...
With the attached patch as an example, how do I make it possible to use the numbers 2000, 4000 and 5200 a creations arguments, but still use the said numbers as defaults, should no arguments be supplied?
Confused at a very basic level, unfortunately :-)
I seem to get most of the other stuff with pd, esp the audio part, but I'm always messing up when it comes to creation arguments in abstractions. What would be required read-up (besides the *dollarsign*.pd files under doc/2.control.examples) that'll allow me to grasp this aspect?
On Thu, 2007-10-18 at 02:44 +0200, Atte André Jensen wrote:
Hi
Still a lot to learn...
With the attached patch as an example, how do I make it possible to use the numbers 2000, 4000 and 5200 a creations arguments, but still use the said numbers as defaults, should no arguments be supplied?
Confused at a very basic level, unfortunately :-)
I seem to get most of the other stuff with pd, esp the audio part, but I'm always messing up when it comes to creation arguments in abstractions. What would be required read-up (besides the *dollarsign*.pd files under doc/2.control.examples) that'll allow me to grasp this aspect?
there is no mechanism in pd, that allows you to check, whether a certain argument for an abstraction was specified or not. when a certain argument is not given, pd just assumes '0'. if '0' is not part of your intended argument range, you can check in your abstraction, if the argument is '0' and assume, when it is '0', that it was not specified.
[loadbang] | [list $1] <- allows both, symbols and floats | [sel 0] | | [53 ] | <- your default value (could also be a symbol) | / | / | / | / |/ [t a]
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Hallo, Roman Haefeli hat gesagt: // Roman Haefeli wrote:
there is no mechanism in pd, that allows you to check, whether a certain argument for an abstraction was specified or not. when a certain argument is not given, pd just assumes '0'. if '0' is not part of your intended argument range, you can check in your abstraction, if the argument is '0' and assume, when it is '0', that it was not specified.
[loadbang] | [list $1] <- allows both, symbols and floats
[list append $1] <- allows both, symbols and floats
| [sel 0] | | [53 ] | <- your default value (could also be a symbol) | / | / | / | / |/ [t a]
Frank Barknecht _ ______footils.org__
yo, hi frank and IOhannes
On Thu, 2007-10-18 at 08:04 +0200, Frank Barknecht wrote:
[loadbang] | [list $1] <- allows both, symbols and floats
[list append $1] <- allows both, symbols and floats
On Thu, 2007-10-18 at 09:21 +0200, IOhannes m zmoelnig wrote:
shouldn't this be [list append $1]?
yes, of course. thanks
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
IOhannes m zmoelnig wrote:
[list $1] <- allows both, symbols and floats
shouldn't this be [list append $1]?
I tried both and both seem to work. There might be some situations where the "append" make a difference, though...
Atte André Jensen wrote:
IOhannes m zmoelnig wrote:
[list $1] <- allows both, symbols and floats
shouldn't this be [list append $1]?
I tried both and both seem to work. There might be some situations where the "append" make a difference, though...
as long as you use numbers as $1 you are right. however, when you use a symbol other than "append", "split", "prepend", "trim" (and probably some more), your [list $1] will fail to create. in the cases where it creates, it will behave not as expected.
fm,gasdr IOhannes
Roman Haefeli wrote:
if '0' is not part of your intended argument range, you can check in your abstraction, if the argument is '0' and assume, when it is '0', that it was not specified.
Ok, thanks.
What can I do then about audio rate inlets? As far as I understand they supply continious streams thus overriding and creation arguments I might supply. Is there something like [sel~] that'll only send the signal on should it be different from 0?
Atte André Jensen wrote:
Roman Haefeli wrote:
if '0' is not part of your intended argument range, you can check in your abstraction, if the argument is '0' and assume, when it is '0', that it was not specified.
Ok, thanks.
What can I do then about audio rate inlets? As far as I understand they supply continious streams thus overriding and creation arguments I might supply. Is there something like [sel~] that'll only send the signal on should it be different from 0?
this is more tricky. what you are really asking for is a way to detect whether an inlet is connected. i don't know of any way.
control signals can be "0" too... of course you could do something like
[inlet~] | +--+ | [==~] [default_signal~] | | | | [*~ ] | | [+~] |
but that is most likely not what you want.
there is also a [sigzero~] object in zexy which gives you information on whether the entire signal block is "0" (you could do this with [env~] too...)
but basically i would suggest to not do something like that at all.
mfga.dr IOhannes
Hallo, Atte André Jensen hat gesagt: // Atte André Jensen wrote:
What can I do then about audio rate inlets?
Inlets (sig and control) and arguments aren't related in any predefined way. Obviously you cannot pass signals itself as arguments, only symbols and numbers are possible, so any conversion to signals has to happen using some dsp object.
As far as I understand they supply continious streams thus overriding and creation arguments I might supply. Is there something like [sel~] that'll only send the signal on should it be different from 0?
Is [sig~ $1] of any help? It will take the signal to generate from the first argument. If that is missing, it would be the same as [sig~ 0]. The same of course is possible with any dsp-object that accepts arguments, like [hip~ $1] etc.
Frank Barknecht _ ______footils.org__