<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-forward-container">I forgot to cue this mail to
      list, here it is<br>
      <br>
      -------- Message transféré --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Sujet :
            </th>
            <td>Re: [PD] Dynamic selection of dac~ channel</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date : </th>
            <td>Mon, 10 Nov 2014 19:12:06 +0100</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">De : </th>
            <td>patrice colet <a class="moz-txt-link-rfc2396E" href="mailto:colet.patrice@free.fr"><colet.patrice@free.fr></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Pour : </th>
            <td>Alessio Degani <a class="moz-txt-link-rfc2396E" href="mailto:alessio.degani@ymail.com"><alessio.degani@ymail.com></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>hi

Le 10/11/2014 18:36, Alessio Degani a écrit :
> Hi List,
>
> I've a simple abstraction that instantiate a single output channel 
> plus a VU meter and a mute switch. In this abstraction I create a dac~ 
> object. I would like to make this channel selectable by a creation 
> argument.
> This is simple to obtain by using the object [dac~ $1] but this make 
> mandatory for the user so give the channel number as a creation argument.
> If I instantiate the abstraction without a creation argument, $1 will 
> be 0, and thus, I've no output to the dac.
>
> What I want is:
> - when the patch is instantiated as [patch_name channel_num], the dac~ 
> object in that patch should be [dac~ channel_num]
> - when the patch is instantiated as [patch_name], the dac~ object in 
> that patch should be [dac~ 1] (or other default channel)
>
> I've temporarily resolved this using throw~, since the throw object 
> accept the message [set bus_name(, but in this way, I'm forced to 
> create the correspondant [catch~ bus_name] and link them to a given 
> [dac~ channel_num].
> And I don't want this! :)
>

why don't you want this?
> Basically, I need a procedure to set the dac~ channel during the init 
> of an abstraction to $1 if passed or to default_channe il $1 is not 
> passed.
>

there is a way with dynamic patching, dac~ could be created at 
abstraction init with default arg, if you don't know how to do this I've 
attached an example
> Thank you very much!
>


</pre>
      <br>
    </div>
    <br>
  </body>
</html>