Author |
Message |
Pseudo_Pseudo
Joined: Oct 20, 2009 Posts: 2 Location: England
|
Posted: Wed Oct 28, 2009 6:19 am Post subject:
This code won't work?! |
|
|
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
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Nov 01, 2009 7:59 pm Post subject:
|
|
|
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):
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
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Nov 01, 2009 8:00 pm Post subject:
|
|
|
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
|
|
|
dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Sun Nov 01, 2009 8:05 pm Post subject:
|
|
|
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
|
|
|
Pseudo_Pseudo
Joined: Oct 20, 2009 Posts: 2 Location: England
|
Posted: Mon Nov 02, 2009 7:12 am Post subject:
|
|
|
Thats fixed it, thanks man! |
|
Back to top
|
|
|
|