Author |
Message |
disablek
Joined: May 11, 2007 Posts: 10 Location: disablekville
|
Posted: Fri May 11, 2007 9:39 pm Post subject:
How to load multiple sndbuf |
 |
|
First post!
I've been trying out chuck and in the examples for sndbuf, a fully qualified pathname is required to read in a sound file. Is that supposed to be the case?
I've also got this idea for storing a bunch of files in various folders, based on some kind of group similarity and having chuck randomly pick one to play. But i can't seem to find any native file handling/string handling capability with chuck. Is there any way around it?
The only other way i can think of, is to use perl or bash and randomly feed this to chuck. But this kind of sucks because if you want to attach a midi controller to alter parameters, this won't work because there's no way to marshal all sounds to go through one chuck program.
Any thoughts???? |
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Sat May 12, 2007 2:28 pm Post subject:
|
 |
|
Actually, full path will definitely work well,
but it's not very flexible, so here i go:
The file name you're gonna refer to is based on the 'Current Directory'
mainly, it's the place you're at when running ChucK or miniAudicle or Audicle..
for example, (on Windows)
let's say, i'm at
F:\kijjaz\music\chuck
and the sound file is in
F:\kijjaz\music\sample
I can just refer to the file name by using "..\sample\the-file-name"
so it might be easy if you can start the executable where you're working..
and put the .ck file and all the sound file not for from where you work.
for example i'm in
F:\kijjaz\music\chuck
i might wanna put in some drum samples in
F:\kijjaz\music\chuck\samples\drum
and i can refer to the file by
"samples\drum\the-file-name"
i'll come to talk to you more, take care and have fun chuckin! ..
(i'm a newbie, still hahah) |
|
Back to top
|
|
 |
spencer

Joined: Aug 16, 2006 Posts: 53 Location: northern california
|
Posted: Mon May 21, 2007 2:05 am Post subject:
|
 |
|
Hey,
yeah, to reinforce what kijjaz said, be sure that you "cd" to the correct directory before running chuck or Audicle. If you are using miniAudicle, you can head to the "Preferences" menu and then change the "current directory" (under the miscellaneous tab) to whatever that needs to be.
Also, ChucK does support string concatenation with the "+" operator. E.g. prints out "ab". So that might be sufficient to implement your idea.
spencer |
|
Back to top
|
|
 |
disablek
Joined: May 11, 2007 Posts: 10 Location: disablekville
|
Posted: Mon May 21, 2007 7:44 am Post subject:
|
 |
|
Hey great!
I didn't notice that as an example in the chuck documentation. |
|
Back to top
|
|
 |
spencer

Joined: Aug 16, 2006 Posts: 53 Location: northern california
|
Posted: Mon May 21, 2007 10:32 am Post subject:
|
 |
|
yeah, its a new feature in the most recent release, and unfortunately its really only documented in the examples/ directory of whatever ChucK download package you have.
spencer |
|
Back to top
|
|
 |
|