Send chuck-users mailing list submissions to
chuck-users@lists.cs.princeton.edu
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
or, via email, send a message with subject or body 'help' to
chuck-users-request@lists.cs.princeton.edu
You can reach the person managing the list at
chuck-users-owner@lists.cs.princeton.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of chuck-users digest..."
Today's Topics:
1. Re: Shreds fade out (mario buoninfante)
---------- Forwarded message ----------
From: mario buoninfante <mario.buoninfante@gmail.com>
To: chuck-users@lists.cs.princeton.edu
Cc:
Bcc:
Date: Sun, 31 May 2020 19:31:28 +0100
Subject: Re: [chuck-users] Shreds fade out
_______________________________________________Hi Claudio,
I suspect ChucK just 'kills' the programs when you run
> chuck - 1
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.
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.
One solution could be to kill (and maybe launch as well) your program from a different ChucK script (see Machine section here: https://en.flossmanuals.net/chuck/_full/#standard-libraries), 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()).
One other way could be to have all your programs able to receive msg via OSC.
Then you have a dedicate program that deals with removing them, sending messages via OSC.
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.
For example:
to remove the program with the ID 12.
When this is launched it fires an OSC message that looks like this:
"remove x"
where 'x' is the ID of the program to remove.
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()).
This of course means that all your other programs need to have a simple parser that deals with the incoming OSC msg.
Of course I don't know anything about the context here, so these solutions could be not suitable for you.
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.
Hope this helps, anyway.
Cheers,
Mario
On 30/05/2020 23:33, Claudio Donaggio wrote:
Hi all!
I was wondering if there is a way to smoothly fade out a shred. Example: from command line you add a shred with chuck + shred.ck 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...
Thanks!
Claudio
Inviato dal mio dispositivo mobile Huawei
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users