electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
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
Stereo samples
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
sorenkj



Joined: Apr 27, 2014
Posts: 9
Location: Portugal

PostPosted: Thu May 01, 2014 9:35 am    Post subject: Stereo samples
Subject description: Bug?
Reply with quote  Mark this post and the followings unread

How do you play stereo samples? According to the documentation (http://chuck.cs.princeton.edu/doc/language/ugen.html#chan) I think the following should work, but the sample seems to get mixed down to mono.

Code:
SndBuf s;
me.sourceDir() + "/stereosample.wav" => s.read;
s => dac;
while(true) 1::ms => now;


I also tried the following but then no sound is heard at all.

Code:
SndBuf s;
me.sourceDir() + "/stereosample.wav" => s.read;
s.chan(0) => dac.left;
s.chan(1) => dac.right;
while(true) 1::ms => now;
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4119
Location: Sweden
Audio files: 359
G2 patch files: 100

PostPosted: Fri May 02, 2014 3:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Weird. Have you tried using dac.chan(0) and dac.chan(1) instead of .left and .right, just to check? I'm not by my computer right now, but I can have a quick look when I get home later.
_________________
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
sorenkj



Joined: Apr 27, 2014
Posts: 9
Location: Portugal

PostPosted: Fri May 02, 2014 4:07 am    Post subject: Reply with quote  Mark this post and the followings unread

yes, tried that as well.. maybe this is another problem with Windows or my computer only.. (like this one - http://electro-music.com/forum/topic-61748.html)
Back to top
View user's profile Send private message
Samu



Joined: Aug 03, 2014
Posts: 1
Location: New Zealand

PostPosted: Sun Aug 03, 2014 1:31 am    Post subject: Re: Stereo samples
Subject description: Bug?
Reply with quote  Mark this post and the followings unread

sorenkj wrote:
How do you play stereo samples? According to the documentation (http://chuck.cs.princeton.edu/doc/language/ugen.html#chan) I think the following should work, but the sample seems to get mixed down to mono.

Code:
SndBuf s;
me.sourceDir() + "/stereosample.wav" => s.read;
s => dac;
while(true) 1::ms => now;


I also tried the following but then no sound is heard at all.

Code:
SndBuf s;
me.sourceDir() + "/stereosample.wav" => s.read;
s.chan(0) => dac.left;
s.chan(1) => dac.right;
while(true) 1::ms => now;


To get stereo you need to use SndBuf2.
eg
Code:
SndBuf2 s;
me.sourceDir() + "/stereosample.wav" => s.read;
s => dac;
while(true) 1::ms => now;


Then it won't be mixed down to mono, was having the same problem last week!
Back to top
View user's profile Send private message
sorenkj



Joined: Apr 27, 2014
Posts: 9
Location: Portugal

PostPosted: Mon Sep 01, 2014 5:02 am    Post subject: Reply with quote  Mark this post and the followings unread

ah..! thanks for the tip:)
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 [5 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
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


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