[chuck-users] Shreds fade out
mario buoninfante
mario.buoninfante at gmail.com
Sun May 31 14:31:28 EDT 2020
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:
> cleanup.ck:12
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
> <http://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 at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200531/70d860a4/attachment.html>
More information about the chuck-users
mailing list