electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks GalleryGallery 
 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
Directories in ChucK
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [7 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Plasticman



Joined: Feb 25, 2008
Posts: 11
Location: Ireland

PostPosted: Wed Apr 09, 2008 5:34 am    Post subject: Directories in ChucK Reply with quote  Mark this post and the followings unread

When using Machine.add(), does it use the chuck file's parent directory, or the binary's? I tried to launch a file in a subdirectory with the code below, and the VM reported that the file did not exist.

Code:
Machine.add("./Modules/ModManager.ck");


edit: Could it be because I'm running Windows? The /example/shred/machine.ck example didn't work either.
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 6718
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Apr 09, 2008 6:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Actually, ChucK uses a path relative to the directory from which it was called. That may be the location of the executable, but likely it isn't as likely you put the executable in your path (copying it to /windows/system32/ will do).

If this is a problem you can use the full path in the file-name like;

Machine.add( "d:/chuck/myfiles/drums/snare.ck" );

I recommend using relative paths so you can easily move and distribute your code but this may not always be convenient.

Note that the MiniAudicle has a setting in it's menu to indicate the directory to work from, since it's a graphical application it's location in the directory tree isn't very meaningful most of the time.

Hope that helps.

_________________
Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor



Joined: Oct 13, 2007
Posts: 1700
Location: Florida, USA
Audio files: 67

PostPosted: Wed Apr 09, 2008 6:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Hmmm, I would try:

Code:
Machine.add("Modules/ModManager.ck");


leaving off the "./" at the beginning. Though I really don't know if that would work. ChucK itself should use the directory from which you launched it, and the miniAudicle has a place in the preferences where you can specify the directory. If the above suggestion doesn't work, try looking at this and other path examples in the docs. Good luck.

_________________
For those about to ChucK, we salute you! - Ge Wang
Let's make noise for peace! - kijjaz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Plasticman



Joined: Feb 25, 2008
Posts: 11
Location: Ireland

PostPosted: Wed Apr 09, 2008 11:34 am    Post subject: Reply with quote  Mark this post and the followings unread

I was trying to run it from miniAudicle, once I used the command line it worked fine. Thanks!
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 6718
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Apr 09, 2008 11:42 am    Post subject: Reply with quote  Mark this post and the followings unread

In that case you may want to check the MIni's settings for the starting directory. I think it's in the last tab of the settings.
_________________
Modern technology offers an endless field day to any deviant strains in our personalities. --J.G.Ballard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 568
Location: bangkok, thailand
Audio files: 2

PostPosted: Wed Apr 09, 2008 11:49 am    Post subject: Reply with quote  Mark this post and the followings unread

or do we need to replace / with \ on windows?
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Plasticman



Joined: Feb 25, 2008
Posts: 11
Location: Ireland

PostPosted: Wed Apr 09, 2008 11:50 am    Post subject: Reply with quote  Mark this post and the followings unread

No, ChucK reads \ as an escape character.
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 [7 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

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, 2004, 2005, 2006 and 2007 by electro-music.com