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
SndBuf seems to be mono; how can i make it stereo
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
HAL-1701



Joined: May 02, 2011
Posts: 4
Location: Berkeley

PostPosted: Mon May 02, 2011 3:26 pm    Post subject:  SndBuf seems to be mono; how can i make it stereo
Subject description: SndBuf seems to be mono
Reply with quote  Mark this post and the followings unread

SndBuf seems to be playing in mono. I am loading a stereo .wav file, but playing it comes out mono. I can find no clue of how to do a stereo SndBuf.. but I'm sure it's there somehow!

I used "buf.channels()" and it gives "1". But using "buf.channel" does not seem to *set* the number of channels; i'm not sure what it does.

Below is all the lines in my ChucK program that reference the soundbuffer.

<tia>,

HAL-1701
(Ian)

*****
this is pretty much all i do with the soundbuffer;
elsewhere i change the "buf.rate".. :
*****

Code:
// the patch
SndBuf buf => dac;

// load the file
filename => buf.read;
Back to top
View user's profile Send private message
HAL-1701



Joined: May 02, 2011
Posts: 4
Location: Berkeley

PostPosted: Tue May 03, 2011 11:35 pm    Post subject: Re: SndBuf seems to be mono; how to load a stereo wav file?
Subject description: here is how to read a stereo wavfile into SndBuf that doesn't turn to mono
Reply with quote  Mark this post and the followings unread

if you load (.read) a wav file into a SndBuf, it turns into mono (sum of L+R).

so here is THE ONLY? way apparently to deal with that.

read this:
https://lists.cs.princeton.edu/pipermail/chuck-users/2010-November/005864.html

so, here's the short codesnippet from that:

Code:

// I think SndBuf is always outputting in mono,
// but can read a stereo sample.
// Try this (it works):

SndBuf s_left, s_right;

"stereosoundfile.wav" => filename;
filename => s_left.read;
filename => s_right.read;

0 => s_left.channel;     // not needed
1 => s_right.channel;    // definitely needed !

s_left => dac.left;
s_right => dac.right;

s_left.length() => now;

Back to top
View user's profile Send private message
HAL-1701



Joined: May 02, 2011
Posts: 4
Location: Berkeley

PostPosted: Thu May 05, 2011 5:57 pm    Post subject: SndBuf stereo (multichannels) is broken apparently
Subject description: the LiSa wiki says that stereo recording with SndBuf is broken
Reply with quote  Mark this post and the followings unread

in today's news:

apparently SndBuf currently doesn't play stereo/multichannels correctly.

***

the LiSa wiki's "stereo example" for LiSa says SndBuf is broken;
AND that it will be fixed "in the next release"

(the next after release 1.2.1.4-dev-1...) :

see

http://wiki.cs.princeton.edu/forums.html/LiSa_SndBuf_multichan.ck

... that page says ...

Code:

LiSa SndBuf multichan.ck :

// this is broken in current release 1.2.1.4-dev-1 (dracula); something changed in SndBuf
// will be fixed in next release.

Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 3620
Location: Sweden
Audio files: 255
G2 patch files: 95

PostPosted: Thu May 05, 2011 11:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

A belated welcome HAL-1701!

I've been following this thread, trying to recall the troubles I've had with SndBuf and stereo, but I don't think I got any further than what you posted here. Thanks for posting all the info! The ChucK forum isn't as active as it has been...

There actually seems to be a new release around the corner, so there is still hope for this.

/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
HAL-1701



Joined: May 02, 2011
Posts: 4
Location: Berkeley

PostPosted: Fri May 06, 2011 1:17 am    Post subject: HI to electromusician Antimon
Subject description: ChucK has been good to me this week; all stepstones appearing as needed...
Reply with quote  Mark this post and the followings unread

Ohm... Bug squash compress Theremin

Hi !

I have used Csound (& Cecilia4) to excellent results;
and I'm now trying out ChucK after meeting Ge (!)...
and i like that it reminds me of Processing in many temperament-ways.

BUT I want to try out SuperCollider; and then see which of these three is
what i really want to focus on...

I may likely return to Csound, since I think 'she' sounds beautiful,
and the opcode selection/repertoire seems to beat everything else.

I haven't liked the sounds of Pd (but I like RjDj for mobile 'devices',
and 'generative soundscape toys for everyone')... and MMsp is just not an option.

Event ChucK.next() => now; // I hope it's out soon !

Hey: What language(s) do you recommend; and perhaps, gluing it together with Python? Or, using Processing for the ui and 'visual interactive displays' and maybe other things it does well?

Thanks Stefan..

// HAL-1701
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 3620
Location: Sweden
Audio files: 255
G2 patch files: 95

PostPosted: Fri May 06, 2011 2:51 am    Post subject: Reply with quote  Mark this post and the followings unread

I have only glanced briefly at CSound and Supercollider. I think I stuck with ChucK partly because of the then enthusiastic community here, partly because parts of ChucK is heavily inspired by Java (which has been my main programming environment professionally almost since it appeared), and partly because I like the clock concept. I don't know enough about the other languages to offer any better comparison than that. I love to talk with ChucK using OSC from my monome, but my understanding is that OSC works equally well in all these environments.

The monome is my main visual interface - if you're on a Mac you might want to check out MAUI (though I'm at a loss where to find documentation for it). Since I'm a Java man, I've done some ChucK applications that rely on a Java GUI that talks OSC, but I usually stay in ChucK-land. I've done one app that relied on a command line interface ( http://electro-music.com/forum/viewtopic.php?highlight=cli+sequencer&t=21431 ).

I've made stabs at PureData, which I mostly find confusing. I am currently dabbling with Max4Live, I am slightly hopeful that I might make some use out of it.

On a higher level, the Nord Modular G2 is probably what I've used the most throughout the 7-8 years I've been dabbling with these kinds of music tools. The free demo is well worth checking out! It's more limited, but incredibly accessible.

Are you aware of the ChucK mailing list?

https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

I think nowadays there is a better chance to get a good answer to questions like your own there than here.

_________________
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
McKein



Joined: Feb 22, 2012
Posts: 3
Location: Norway

PostPosted: Wed Feb 22, 2012 6:22 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello there. I'm have my head mixed up, i can't make actual difference between sndbuf and recvbuf? I wonder, do they have a different behaviour/role when using stream forest City HS Class of 1975 sockets ?
Last edited by McKein on Thu Jul 18, 2013 8:32 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
GrandJu



Joined: Jul 04, 2010
Posts: 32
Location: Rennes France

PostPosted: Wed Feb 22, 2012 9:30 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi McKein,
And Welcome in the marvelous world of ChucK welcome

Is recvbuf an UGen? I cannot find it in the Manual.

sndbuf is an UGen to read wav files. Easy to use, check examlpes!

Have Fun

Ju
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 [8 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
emSynth

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