opendialog fold problem?

Dec 30, 2010 at 6:20pm

opendialog fold problem?

Hi, Im trying to create a patch that allows you to choose which folder you want an sfplay to open a .wav from. In the patch I have created I get the message- open”C:/Users/LEE/Desktop/drum project/drums/bassdrum/”bassdrum. But what i need is for the last bassdrum to appear in between the / and the ” so the message would read- open”C:/Users/LEE/Desktop/drum project/drums/bassdrum/bassdrum” any ideas???
Thanks lee

Attachments:
  1. autoload.maxpat
#54165
Dec 30, 2010 at 6:30pm

sprintf is your friend.

– Pasted Max Patch, click to expand. –
#194881
Dec 30, 2010 at 6:53pm

Cheers chris I have set the patch up with the sprintf putting bassdrum.wav into the message as that is what the wav file is called. but it doesnt load the sample into sfplay. i think the reason is that their is no ” in the message. any ideas? Thanks
Lee

#194882
Dec 30, 2010 at 6:59pm

heres the patch ive tested it with.

Attachments:
  1. autoload.maxpat
#194883
Dec 30, 2010 at 7:26pm

use “symout” with the [sprintf] so you don’t have problems if there are spaces in the file path.

I think we need a Sticky or a general Help file (or documentation page) specifically to deal with filepath issues using [sprintf] [combine] etc. Though the [sprintf] help file addresses this, it still comes up far too often and it’s a pain to figure out…

– Pasted Max Patch, click to expand. –
#194884
Dec 30, 2010 at 11:25pm

>Cheers chris I have set the patch up with the sprintf putting
>bassdrum.wav into the message as that is what the wav file
>is called. but it doesnt load the sample into sfplay.

that only works when bassdrum.wav is in your max search path.

#194885
Dec 31, 2010 at 3:17am

@themagicwoodshed – the first and second patchers you posted were the same, no?

At any rate, this works for me:

– Pasted Max Patch, click to expand. –
#194886

You must be logged in to reply to this topic.