Forums > MaxMSP

opendialog fold problem?

December 30, 2010 | 6:20 pm

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

December 30, 2010 | 6:30 pm

sprintf is your friend.

– Pasted Max Patch, click to expand. –

December 30, 2010 | 6:53 pm

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


December 30, 2010 | 6:59 pm

heres the patch ive tested it with.

Attachments:
  1. autoload.maxpat

December 30, 2010 | 7:26 pm

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. –

December 30, 2010 | 11:25 pm

>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.


December 31, 2010 | 3:17 am

@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. –

Viewing 7 posts - 1 through 7 (of 7 total)