<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Claudio,</p>
    <p>I suspect ChucK just 'kills' the programs when you run <br>
    </p>
    <p>&gt; chuck - 1</p>
    <p>from terminal. What it does it's just sending the 'remove'
      command to the Virtual Machine, so the program itself is not
      really aware of what's going on.<br>
    </p>
    <p>If you want to fade the program out (or do any other operation)
      before removing it, you must find a way to let it know first, if
      that makes sense.</p>
    <p>One solution could be to kill (and maybe launch as well) your
      program from a different ChucK script (see Machine section here:
      <a class="moz-txt-link-freetext" href="https://en.flossmanuals.net/chuck/_full/#standard-libraries">https://en.flossmanuals.net/chuck/_full/#standard-libraries</a>), at
      this point you could put the 2 in communication and have the
      parent program sending an Event to the child before killing it, so
      that the latter has the time to fade out and then 'remove' itself
      (ie me.exit()).</p>
    <p>One other way could be to have all your programs able to receive
      msg via OSC. <br>
    </p>
    <p>Then you have a dedicate program that deals with removing them,
      sending messages via OSC.</p>
    <p>For example you can have a cleanup.ck program that simply takes
      one argument (provided via terminal) that is the ID of the program
      to remove.</p>
    <p>For example:<br>
    </p>
    <p>&gt; cleanup.ck:12</p>
    <p>to remove the program with the ID 12.<br>
    </p>
    <p>When this is launched it fires an OSC message that looks like
      this: <br>
    </p>
    <p>"remove x" <br>
    </p>
    <p>where 'x' is the ID of the program to remove.</p>
    <p>Now all the other "active" programs receive this message, but
      only the one with the right ID will respond to it and maybe run
      your cleanupAndLeave() function, that fades out and exits
      (me.exit()).</p>
    <p>This of course means that all your other programs need to have a
      simple parser that deals with the incoming OSC msg.<br>
    </p>
    <p><br>
    </p>
    <p>Of course I don't know anything about the context here, so these
      solutions could be not suitable for you.</p>
    <p>Maybe if you share a bit more about how and why you're trying to
      achieve this, we'd be able to provide a bit more support.</p>
    <p><br>
    </p>
    <p>Hope this helps, anyway.<br>
    </p>
    <p><br>
    </p>
    <p>Cheers,</p>
    <p>Mario<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 30/05/2020 23:33, Claudio Donaggio
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPJrx1X8h9F9EG5HyVie_jBo1UEsC8tNRBvuJO0yjre9vp8jkw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">
          <div style="width:328px;margin:16px 0px">
            <div><br>
              <br>
              Hi all!<br>
              I was wondering if there is a way to smoothly fade out a
              shred. Example: from command line you add a shred with
              chuck + <a href="http://shred.ck/"
                style="text-decoration-line:none;color:rgb(66,133,244)"
                moz-do-not-send="true">shred.ck</a> and remove it with
              chuck - 1. But when you remove the shred or replace it
              gets cut off instantly. I am sure there is a way to
              dinamically scale the gain from 1 to 0 smoothly before
              remove the shred, but I do not have a clue on how to go
              about it...<br>
              Thanks!<br>
              Claudio<br>
              <br>
              Inviato dal mio dispositivo mobile Huawei</div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
chuck-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a>
<a class="moz-txt-link-freetext" href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a>
</pre>
    </blockquote>
  </body>
</html>