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 
 Forum index » DIY Hardware and Software » ChucK programming language
Pitch envelopes?
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
lambdoid



Joined: Dec 12, 2008
Posts: 3
Location: Basingstoke

PostPosted: Fri Dec 12, 2008 1:56 pm    Post subject: Pitch envelopes? Reply with quote  Mark this post and the followings unread

Hi all. New to this forum. I downloaded ChucK a few days ago, and so far so good. Absolutely loving it! Already made a random beat generator, using an array of probabilites. Will post it if anyone's interested.

What I was wondering is how can you do a pitch envelope. I managed to use the ADSR class for amplitude and filtering, but I'm stumped with the pitch.

I'd also like to know if there's a boolean type, and if not, what constitutes truth(in a programming sense, not a philosophical one lol).
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Fri Dec 12, 2008 4:04 pm    Post subject: Re: Pitch envelopes? Reply with quote  Mark this post and the followings unread

lambdoid wrote:
Hi all. New to this forum. I downloaded ChucK a few days ago, and so far so good. Absolutely loving it! Already made a random beat generator, using an array of probabilites. Will post it if anyone's interested.


Sounds great, welcome on board! I think sharing code is nice in any case; it may help others and you might get valuable feedback. It's probably a good idea to briefly point out how you feel about others working with your code; is it for information only, do you encourage "remixes", etc.

Quote:
What I was wondering is how can you do a pitch envelope. I managed to use the ADSR class for amplitude and filtering, but I'm stumped with the pitch.


Well, there are several ways, depending on your needs and preferences. I'm not sure what the issue is; if you can modulate a filter using a ADSR you should be able to modulate a sound-source as well, in fact both tend to use ".freq()". Maybe I'm missing the exact nature of your question?


Quote:
I'd also like to know if there's a boolean type, and if not, what constitutes truth(in a programming sense, not a philosophical one lol).


No, there is no boolean type as such. "true" and "false" are keywords that resolve to "1 (int)" and "0 (int)" respectively. The "!" operator will resolve to 0 for any non-zero int and 1 for a input of "0". I tend to use quite a few arrays that are basically boolean yet are represented by a int data-type. This works without issue.

Conditions like "while" or "if" will be satisfied for any non-zero value, I recommend using a int instead of a float as float can and will have very slight rounding errors; the tenth decimal digit may be non-zero, for example, throwing your plans off.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lambdoid



Joined: Dec 12, 2008
Posts: 3
Location: Basingstoke

PostPosted: Sat Dec 13, 2008 3:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've found a couple of simple ways of doing it in the example files chirp.ck and chirp2.ck, which is a start.

The one in chirp2.ck is based on a simple envelope, but I'd like a full ADSR, with 3 separate pitch parameters ie the initial pitch, the pitch at the end of the attack phase, and the last value would be the release pitch. The pitch at the sustain phase would be the original pitch.

I'll post my drum generator in its own thread.
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
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