electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Supercollider
is there a .stop method?
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
flies



Joined: May 20, 2008
Posts: 33
Location: NJ

PostPosted: Sun Aug 30, 2009 10:47 am    Post subject: is there a .stop method?
Subject description: more noob questions
Reply with quote  Mark this post and the followings unread

going through the getting started tutorials here.

let's say i defined an object, x = { SinOsc.ar(400) };

x.play; will set my sine wave going. how do i stop it? is there a x.kill method or the like? (i know alt . will stop everything (on PC), but i'm looking for a less drastic solution.)

also: is there a way to change the pitch of x as written? if not, how would i define an object so that i could say x.changePitch(200); or similar? even better, how can i say x.changePitch(200+(20*SinOsc.kr(1))) ?

am noob. plz helps.
Back to top
View user's profile Send private message
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Mon Aug 31, 2009 5:49 am    Post subject: Reply with quote  Mark this post and the followings unread

x is a function - no way to stop a function.

Code:
y = x.play;


Now 'y' is a synth, and you can .free it, and also use .set to change control inputs etc.

Code:
// collapsing x and y into one
y = { |freq = 400| SinOsc.ar(freq) }.play;

y.set(\freq, 800);


You can't directly add new units into a synth while it's playing, but you can map an input to a control bus and play whatever you want onto that bus.

Code:
c = Bus.control(s, 1);
y.set(\freq, c.asMap);   // or y.map(\freq, c);
z = { SinOsc.kr(1, 0, mul: 20, add: 200) }.play(outbus: c);


James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
flies



Joined: May 20, 2008
Posts: 33
Location: NJ

PostPosted: Mon Aug 31, 2009 10:14 am    Post subject: Reply with quote  Mark this post and the followings unread

great. thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Supercollider
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use