Discussion:
Instruction to stop the sound
Marcos Bernabé
2014-10-12 14:14:13 UTC
Permalink
Hi!

I'm searching for a instruction to execute the same action that "Ctrl+.", I found some Server methods but I'm not happy with the effect. What can I do?

thank you
marcos
Andrea Valle
2014-10-12 15:49:49 UTC
Permalink
Check CmdPeriod

HTH

-a-

--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.valle-Ob+***@public.gmane.org
--------------------------------------------------

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a lotta what-have-yous."
(Jeffrey 'The Dude' Lebowski)
Post by Marcos Bernabé
Hi!
I'm searching for a instruction to execute the same action that "Ctrl+.", I found some Server methods but I'm not happy with the effect. What can I do?
thank you
marcos
Dan Zink
2014-10-12 17:43:39 UTC
Permalink
You have two options.

If you haven't explicitly attached any nodes to the RootNode (you'd
probably know if you were doing this), then you can execute
s.defaultGroup.freeAll from sclang. This will free all nodes attached to
the default group, but not the default group itself, and is the safest
thing to do.

If you HAVE attached things to the root node, then I would suggest not
doing that, but if you must, you can also free EVERYTHING on the server
with s.freeAll.

Both of these assume that your server is stored in the variable 's'.
Post by Andrea Valle
Check CmdPeriod
HTH
-a-
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--------------------------------------------------
"This is a very complicated case, Maude. You know, a lotta ins, a lotta
outs, a lotta what-have-yous."
(Jeffrey 'The Dude' Lebowski)
Hi!
I'm searching for a instruction to execute the same action that "Ctrl+.",
I found some Server methods but I'm not happy with the effect. What can I
do?
thank you
marcos
Eli Fieldsteel
2014-10-12 18:10:30 UTC
Permalink
But hang on, manually pressing command-period does more than just free all
the nodes in the default group, doesn't it? If you've got an
EventStreamPlayer actively generating Synths, then manually pressing command
period will free all nodes AND stop all EventStreamPlayers, but s.freeAll
only frees nodes, leaving EventStreamPlayers untouched.

If there's a line of code which, when executed, does EXACTLY the same thing
as command-period, then I'm not aware of it. So I'm curious about this as
well.

Eli



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Instruction-to-stop-the-sound-tp7613946p7613951.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Dan Zink
2014-10-12 18:40:23 UTC
Permalink
You're right, and though I thought of that, I figured I would wait until OP
asked for clarification if needed. But since you called me out on it :p I
looked up how the gedit plugin does it. I turns out it's really simple:

The main process of SuperCollider is held in a variable called thisProcess;
calling "thisProcess.stop" worked for me to stop all sound and processes.
Post by Eli Fieldsteel
But hang on, manually pressing command-period does more than just free all
the nodes in the default group, doesn't it? If you've got an
EventStreamPlayer actively generating Synths, then manually pressing command
period will free all nodes AND stop all EventStreamPlayers, but s.freeAll
only frees nodes, leaving EventStreamPlayers untouched.
If there's a line of code which, when executed, does EXACTLY the same thing
as command-period, then I'm not aware of it. So I'm curious about this as
well.
Eli
--
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Instruction-to-stop-the-sound-tp7613946p7613951.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Dan Zink
2014-10-12 18:46:16 UTC
Permalink
There's also a method called thisProcess.hardstop, but it's undocumented on
3.6.3 so I'll leave it to you to explore
Post by Dan Zink
You're right, and though I thought of that, I figured I would wait until
OP asked for clarification if needed. But since you called me out on it :p
The main process of SuperCollider is held in a variable called
thisProcess; calling "thisProcess.stop" worked for me to stop all sound and
processes.
Post by Eli Fieldsteel
But hang on, manually pressing command-period does more than just free all
the nodes in the default group, doesn't it? If you've got an
EventStreamPlayer actively generating Synths, then manually pressing command
period will free all nodes AND stop all EventStreamPlayers, but s.freeAll
only frees nodes, leaving EventStreamPlayers untouched.
If there's a line of code which, when executed, does EXACTLY the same thing
as command-period, then I'm not aware of it. So I'm curious about this as
well.
Eli
--
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Instruction-to-stop-the-sound-tp7613946p7613951.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-10-12 20:03:54 UTC
Permalink
Post by Eli Fieldsteel
If there's a line of code which, when executed, does EXACTLY the same thing
as command-period, then I'm not aware of it. So I'm curious about this as
well.
CmdPeriod.run

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2014-10-13 00:30:34 UTC
Permalink
Post by Daniel Mayer
Post by Eli Fieldsteel
If there's a line of code which, when executed, does EXACTLY the same thing
as command-period, then I'm not aware of it. So I'm curious about this as
well.
CmdPeriod.run
Yes, this is *the* correct way to do it. It's better than thisProcess.stop
because you might have registered custom CmdPeriod actions. I'm not sure if
thisProcess.stop will run those, but I bet not.

Actually Andrea already pointed you to the CmdPeriod help file, but you
didn't see it.. ;)

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com





_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Loading...