Referring to a file path from any location.

Mar 7, 2008 at 12:58pm

Referring to a file path from any location.

Hi there,

How do I go about loading a file into a buffer from any computer given that the sound files will be neatly stored in a subfolder called ‘Sounds’

I can load the sounds on any computer without specifying a path should both the sound files and patch be in the same folder but what if the soundfiles are in a subfolder relative to the main patch?

max v2;
#N vpatcher 5 40 605 440;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 371 246 220 9109513 replace ./Sounds/PL_RN_snarfifth2.wav;
#P newex 307 207 96 9109513 sprintf %s %s %s%s;
#B color 5;
#P newex 307 319 102 9109513 buffer~ Column1 1000;
#P newex 307 237 27 9109513 t b s;
#P newex 307 150 76 9109513 sprintf %s%s;
#B color 5;
#P newex 307 176 169 9109513 prepend set replace ./Sounds/;
#P window linecount 3;
#P message 307 270 174 9109513 replace ./patches/Sounds/PL_RN_snarfifth2.wav;
#P window linecount 1;
#P newex 307 119 61 9109513 append .wav;
#P user ubumenu 262 77 100 9109513 0 1 1 0;
#X setrgb 45 255 8 0 0 0 10 7 58 4 4 4 17 17 17 0 0 0;
#X add PL_kli_hhc_01;
#X add PL_kli_hhc_02;
#X add PL_kli_hhc_hinthin;
#X add PL_kli_metallong_01;
#X add PL_kli_metalmuted_01;
#X add PL_kli_rimshot;
#X add PL_kli_rimshot-rev;
#X add PL_kli_tommyboy;
#X add PL_kli_varihivari_01;
#X add PL_RC_bdb_01;
#X add PL_RC_clik_0;
#X add PL_RC_clik_1;
#X add PL_RC_dblbdwivlitilnois;
#X add PL_RC_getinshorter_02;
#X add PL_RC_junkysnr;
#X add PL_RC_junkysnr2;
#X add PL_RC_nanolik;
#X add PL_RC_nanolik2;
#X add PL_RC_nik2;
#X add PL_RN_bdul_1;
#X add PL_RN_chh1;
#X add PL_RN_chh2;
#X add PL_RN_clikbdtail2;
#X add PL_RN_cow;
#X add PL_RN_ohh2;
#X add PL_RN_snarfifth2;
#X add PL_SPL_hh_06;
#X prefix_set 0 0 0;
#P connect 0 1 1 0;
#P connect 1 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 7 0;
#P connect 7 0 5 0;
#P connect 5 0 2 0;
#P connect 5 1 2 0;
#P connect 2 0 6 0;
#P connect 7 0 8 0;
#P pop;

Thanks,

Rhys

#36243
Mar 7, 2008 at 2:04pm

> How do I go about loading a file into a buffer from any computer given that the sound files will be neatly stored in a subfolder called ‘Sounds’
>
> I can load the sounds on any computer without specifying a path should both the sound files and patch be in the same folder but what if the soundfiles are in a subfolder relative to the main patch?
>
>

The (path) message sent to [thispatcher] in a saved patch will give you
the patch path:
(save on your HDD before trying)

#P window setfont “Sans Serif” 9.;
#P user ubumenu 322 137 100 196617 0 1 1 0;
#X setrgb 45 255 8 0 0 0 10 7 58 4 4 4 17 17 17 0 0 0;
#X add PL_kli_hhc_01;
#X add PL_kli_hhc_02;
#X add PL_kli_hhc_hinthin;
#X add PL_kli_metallong_01;
#X add PL_kli_metalmuted_01;
#X add PL_kli_rimshot;
#X add PL_kli_rimshot-rev;
#X add PL_kli_tommyboy;
#X add PL_kli_varihivari_01;
#X add PL_RC_bdb_01;
#X add PL_RC_clik_0;
#X add PL_RC_clik_1;
#X add PL_RC_dblbdwivlitilnois;
#X add PL_RC_getinshorter_02;
#X add PL_RC_junkysnr;
#X add PL_RC_junkysnr2;
#X add PL_RC_nanolik;
#X add PL_RC_nanolik2;
#X add PL_RC_nik2;
#X add PL_RN_bdul_1;
#X add PL_RN_chh1;
#X add PL_RN_chh2;
#X add PL_RN_clikbdtail2;
#X add PL_RN_cow;
#X add PL_RN_ohh2;
#X add PL_RN_snarfifth2;
#X add PL_SPL_hh_06;
#X prefix_set 0 0 0;
#P window linecount 1;
#N thispatcher;
#Q end;
#P newobj 217 281 61 196617 thispatcher;
#P message 217 256 29 196617 path;
#P newex 268 304 173 196617 sprintf symout %sSounds/%s.wav;
#P newex 268 348 81 196617 prepend replace;
#P newex 367 178 30 196617 t b s;
#P newex 268 376 32 196617 print;
#P connect 2 0 0 0;
#P connect 3 0 2 0;
#P connect 5 1 3 0;
#P connect 1 1 3 1;
#P connect 1 0 4 0;
#P connect 6 1 1 0;
#P connect 4 0 5 0;
#P window clipboard copycount 7;

Cheers

#124255
Mar 7, 2008 at 4:05pm

Excellent. Thanks very much!

#124256

You must be logged in to reply to this topic.