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 » ChucK programming language
.phase - ( float , READ/WRITE ) - current phase
Post new topic   Reply to topic Moderators: Kassen
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
brutusx



Joined: Apr 12, 2011
Posts: 8
Location: Canada

PostPosted: Thu Aug 25, 2011 7:02 am    Post subject: .phase - ( float , READ/WRITE ) - current phase
Subject description: phase get/set question
Reply with quote  Mark this post and the followings unread

Newbie question:

Can someone clarify how I could poll the current phase value of a UGen?

Here's what the manual says, but I'm not clear on how exactly this works:
.phase - ( float , READ/WRITE ) - current phase
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Thu Aug 25, 2011 7:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Something like this?

Code:
<<< "Beware, the phase is ", myUgen.phase() >>>;


or

Code:
if (myUgen.phase() > 0.6) {
// Do crazy thing
}


The READ/WRITE thing means that you can also set the phase:

Code:
0.34 => myUgen.phase;


which is equivalent to:

Code:
myUgen.phase(0.34);


/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
brutusx



Joined: Apr 12, 2011
Posts: 8
Location: Canada

PostPosted: Thu Aug 25, 2011 7:23 am    Post subject: Reply with quote  Mark this post and the followings unread

That's great. I will play around with .phase now.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
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 » ChucK programming language
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