filepath and file loading on starttup.
Hi all
I have a question about practices that I've been doing since 2006 .
It has to do with file loading and paths.
For dynamic patcher locations I use [path]-[thispatcher] [sprintf symout] OR [combine path name].
HARDCODING FILES:
What I like about Jitter for fileloading is the "hardcoding" possibility like [jit.gl.texture @file name ] [jit.movie @moviefile name].
(avoiding: loadbang - delay or loadmess-pipe )
But for the file to load on startup , they have to be at the same level as the patcher.
OR
If your content is placed in a folder name "media" then you need the entire filepath starting from the root.
ex: [ jit.gl.texture @file "Macintosh HD:/Users/philippehughes1/Lightbulb/Projects/media/05_ staircase.aif" ]
The problem with this is that if you change your patcher location
So, I would like to know how I could keeping "hardcoding" dynamic and to know how to simply search 1 folder down.
What I mean is , keep my content in a folder name "media"
Ex: [jit.gl.texture @file "~/media/dog.aif" ]
That way I wouldn't have to :
1. could move my patcher anywhere and simply have a folder "media" and filename.
2. could avoid have to use the path name building with [path] [thispatcher] ....
---
Again, I could I have the equivalent of [@file "~/media/filename.mov" ]
Endless thanks
phiol
Hi Philippe, If I understand correctly you just want to create a folder to place all your 'media' archives and read them from there. I generally do this going to Options/File Preferences.../add_your_user_path_to_'media'_folder. Hope it helps!
Thanks 2k
1. what I want, is to create a relative path. It is relative to where my patch is located.
Not an absolute path from the Root .
2. I want to know if this can be done having the name "hardcoding " in the object.
jit.gl.texture @file "~/media/bass.aif"
could be
jit.gl.texture @file "./media/bass.aif"
jit.gl.texture @file "*./media/bass.aif"
jit.gl.texture @file " /media/bass.aif"
jit.gl.texture @file "\./media/bass.aif"
I did try all of these, but no go.
Was wondering if anyone had any pointers, or maybe Max simply does not permit this.
Many other software do:
simply /media/bass.aif
Check out the [conformpath] object.
The [conformpath] can handle the relative paths, and convert/output a full path for use.
Also be aware, if you are using this in the max environment (not a standalone), the relative path is from where max is installed, not from where the patch is stored.
About the hardcoding, what I know is that if a file is in a searchpath, even in a folder within a folder etc, just use its name i.e. "bass.aif" and not "./media/bass.aif"
Nick
Thanks for the answer nikolas,
I know all about the conformpath , relativepath, absolutepath , path message to this patcher.
And the
[;
max sendapppath r_object_name].
What is my interest is the "hardcoding".
And, I can confirm you are mistaking by saying
>> what I know is that if a file is in a searchpath, even in a folder within a folder etc, just use its name i.e. "bass.aif" and not "./media/bass.aif"
It has to be at the same level as the Patcher. I just tried it again. Try it for yourself.
To behave like you mentioned, do I have to change something in the preferences. I doubt it.
The only thing I see in preferences is : Add Patchers to search Path on Save.
Thanks again
Phiol
you must either specify the full path, or place the file in the search path.
while the current working directory is dynamically added to the search path, it is not recursive (i.e. the contents of folders in the current working directory are not added). also, the current working directory changes based on the path of the most recently opened file, so you may not want to rely on that path.
projects are probably useful if you want to load files without an absolute path.
Thanks for the info Rob,
I will repeat to make I fully grasp:
>>you must either specify the full path, or place the file in the search path.
By search path you mean relative to the Max path. Like package or library
Nothing new for me here.
>>while the current working directory is dynamically added to the search path,
it is not recursive (i.e. the contents of folders in the current working directory are not added).
Not sure I grasp. Sorry
>projects are probably useful if you want to load files without an absolute path.
I guess this could be a solution.
thanks
ps.
Could I make this a feature request for future releases ?
a relative path to the patcher
- i.e. [jit.gl.texture @file /media/texture1/dog.png]
that way the absolute path section could be dynamic and stay hardcoded !
Thanks very much
phiol
if you have a folder structure of assets you want accessible across all your projects without specifying full path, just add that folder to the global Max search patch.
if you have a folder structure of assets you want accessible on a specific project, then create a project and add that folder to the project's search path.
in both these cases, the assets can be referred to and loaded using just their file name.
there are no plans to support relative paths in Max at this time.
extra crispy clear
endless thx rob