electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
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 

Short outage tonight at 10 PM EST, 3:00 UTC

click on image to sign up

 Forum index » DIY Hardware and Software » ChucK programming language
Trouble retreiving env durations as milliseconds
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
cbit



Joined: Dec 01, 2005
Posts: 35

PostPosted: Fri Nov 06, 2009 5:43 am    Post subject: Trouble retreiving env durations as milliseconds Reply with quote  Mark this post and the followings unread

I'm trying to retrieve a duration from an envelope portion and store is as a float (corresponding to milliseconds duration). Can someone tell me what I'm doing wrong here?

Code:
ADSR env => blackhole;
env.set(0::ms, 200::ms, 0.0, 200::ms);
env.releaseTime()/1::ms => float mscount;

// I expected next line to print "200", but get "nan" instead
<<< mscount >>>;

_________________
http://basementhum.blogspot.com
Back to top
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145

Audio files: 373
G2 patch files: 100

PostPosted: Fri Nov 06, 2009 7:07 am    Post subject: Reply with quote  Mark this post and the followings unread

It seems that ADSR doesn't like it when you set sustain to 0.0. Try setting it to 0.00001 or lower.

I wouldn't say you're doing anything wrong - zero sustain makes perfect sense for imitating, say, a piano that fades out slowly towards zero while you hold down the key then faster when you release. A bug in ADSR I'd say.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile
cbit



Joined: Dec 01, 2005
Posts: 35

PostPosted: Fri Nov 06, 2009 11:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Ahh, thanks stefan. That fixes it.

What's the proper bug reporting procedure for chucK?

_________________
http://basementhum.blogspot.com
Back to top
View user's profile Send private message Visit poster's website
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
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org