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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
  host / artist show at your time
today> Twyndyllyngs not postponed Chez Mosc
 Forum index » DIY Hardware and Software » ChucK programming language
Chords in chuck
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
OYTIS



Joined: Mar 13, 2011
Posts: 2
Location: SPb

PostPosted: Sun Mar 13, 2011 3:00 pm    Post subject: Chords in chuck Reply with quote  Mark this post and the followings unread

Hello, everyone! I'm trying to use chuck for some experiments and I think I missed something about the language. I just tried to make A minor chord:
Code:

SinOsc s1 => dac;
440 => s1.freq; // A

SinOsc s2 => dac;
523.25 => s2.freq; //C

SinOsc s3 => dac;
659.26 => s3.freq; //E

2::second => now;

and got an awful buzz. What am I doing wrong?
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: Sun Mar 13, 2011 3:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi and welcome

Each UGen defaults to max volume, which is 1.0. When you put on several oscillators the resulting sound will clip digitally, which doesn't sound very pleasant.

Trying lowering the volume, example for s1:

Code:
0.3 => s1.gain


/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
OYTIS



Joined: Mar 13, 2011
Posts: 2
Location: SPb

PostPosted: Mon Mar 14, 2011 3:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, Stefan, it worked! For some reason the gain should be even lower when calling chuck from command line (I used miniaudicle first). It's a bit strange because this code
Code:

Gain g;
2 => g.gain;

SinOsc s1 => g => dac;
440 => s1.freq;

2::second => now;
 

produces nice and clean A. Maybe I just don't get the principle of summing up two signals?

Anton.
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: Mon Mar 14, 2011 11:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hm how do you call it from the command line? It sounds like you're starting two parallell processes...

Also, which ChucK version are you using? There was a bug previously that actually allowed you to go up to 2.0 on the output without clipping, but that should have been fixed by now. Or maybe it's hardware-dependant.

A single note on its own, even if it's clipped, will sound nice enough, just sharper than a pure sinewave. It's when you add notes with other frequencies than you get the harsh distortion effect, maybe that's what you're hearing?

_________________
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
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 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