Forums > MaxMSP

Can't get final quote right in the Text object


Apr 26 2012 | 10:14 am

Hi all,

I’m having a problem showing quotes after a string right in the Text object.
I attach the patch.

If you don’t have Jamoma and sigmund installed you should still be able to click this message:
open "Macintosh HD:/0RubenCsound/Samples/TrasuntinoFullRegisterSamplesDENOIS/Silv8-4-050denois.wav"

I want the remove "Macintosh HD:" since csound doesn’t need it, then add the quotes again. Removing anything before the first / would be even better, since it would also work when the disk has a different name.

prepend " does the right thing, it’s " in message box, and " in the text.
append " however shows as " both is message box and in text.

What’s the secret code to get:
strset 5 , "/0RubenCsound/Samples/TrasuntinoFullRegisterSamplesDENOIS/Silv8-4-006denois.wav"
And not:
strset 5 , "/0RubenCsound/Samples/TrasuntinoFullRegisterSamplesDENOIS/Silv8-4-006denois.wav"

I can’t manage to do it with sprintf or tosymbol.
I would be happy for ideas!

Ruben

Apr 26 2012 | 10:48 am

don’t use [prepend "] [append "], use [tosymbol] instead.

edit : ah. didn’t read it all. my bad. did you try [regexp] ?

edit : ah yes. my bad again. will have a more thorough look…

Apr 26 2012 | 11:05 am

so, it seems a message box won’t accept a symbol containing no space and with quote marks at each end. However hard you’ll try forcing him to do so, he’ll remove it. Didn’t know.

But… it seems to work this way :

-- Pasted Max Patch, click to expand. --

Apr 26 2012 | 11:08 am

Why do you need the quote marks for a single symbol by the way ? Is it a format requirement for Csound strings or something ?

Apr 26 2012 | 11:45 am

Thank you very much! That patch solves the problem.

Yes, it’s the csound string format. I don’t think it will find the file if there are extra spaces.

Ruben

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

Forums > MaxMSP