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 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software » Supercollider
This code won't work?!
Post new topic   Reply to topic Moderators: v-un-v
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
Pseudo_Pseudo



Joined: Oct 20, 2009
Posts: 2
Location: England

PostPosted: Wed Oct 28, 2009 6:19 am    Post subject: This code won't work?! Reply with quote  Mark this post and the followings unread

Hey,

This is probably a noobie question but I have no idea why this code won't work:

-

(
b=Buffer.read(s,"F:/Samples/verbsnare.wav");
)


{PlayBuf.ar(1,b, BufRateScale.kr(b)*SinOsc.ar(0.25,0,100,100), 1, 0, 1)}.play

-

There seems to be no mistakes according to my SC post window- when I run the code it says that it's playing except there no sound?

Any help would be greatly appreciated.
Back to top
View user's profile Send private message
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sun Nov 01, 2009 7:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

Is the server booted? (I suppose it must be... I think there's a warning message for that case.)

If so, try running the playbuf synth this way:

Code:
a = {PlayBuf.ar(1,b, BufRateScale.kr(b)*SinOsc.ar(0.25,0,100,100), 1, 0, 1)}.play;


Then you can do (after playing):

Code:
a.trace;


What's the output of that command?

Playback rate will range between 0 and 100x normal speed this way - is that what you wanted?

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sun Nov 01, 2009 8:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Also be sure you're using the right key command to run code. See the main Help.html file:

Quote:
To execute code, use the keyboard shortcut: Enter (not Return), ctrl-Return, Ctrl-c, fn-Return, or Shift-Return (OS X, SCapp), Ctrl+Enter (Windows, PsyCollider), Ctrl+c Ctrl+c (Emacs), F5 (vim), Ctrl+e (gedit/sced). For key commands, also see Shortcuts.


It's a very common error to use plain <return> and expect that to run code, but it doesn't (by design, to allow entering multi-line blocks of code).

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Sun Nov 01, 2009 8:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Actually, never mind, it's something else entirely.

PlayBuf doesn't like an audio-rate input for the rate argument. Change SinOsc.ar to SinOsc.kr and it should work.

(I'll raise this on the developer list as a potential bug, or at least limitation that should be noted in the documentation.)

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Pseudo_Pseudo



Joined: Oct 20, 2009
Posts: 2
Location: England

PostPosted: Mon Nov 02, 2009 7:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Thats fixed it, thanks man! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: v-un-v
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 » Supercollider
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
mps board

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