Forums > MaxMSP

Newbie Filename Display Question

August 4, 2008 | 2:36 am

Hi there!

I am learning to love MSP.

All I need to know (apart from EVERYTHING) right now is…When I open a wav file how do I get the filename of the opened wav file to appear so I can tell which file I’ve just opened within the the patcher window?

Thanks heaps!

-rb-


August 4, 2008 | 2:58 am

Also…When playing wav files is there a way that you can display graphically where abouts in the wav file you are (so you can tell when the end is coming up with ease)?


August 4, 2008 | 3:04 am

For your first question, it depends on how you’re loading the soundfile. If your using sfplay~ use sfinfo~, and if you’re using play~, groove~, wave~, index~ which all access a buffer~, you use info~.

In any case, start by looking at the help-files for info~ and sfinfo~, then figure out how you’d like to trigger the display operation from either of those objects(with buffer~ it’s pretty easy, just attach info~ to the right-most outlet of a buffer~ object and whenever you read a file into a buffer~, the info~ object will output the filename out it’s right-most outlet).

Here’s an example using buffer~ and info~(remember to name buffer~ and info~ with the same name):

– Pasted Max Patch, click to expand. –

August 4, 2008 | 3:20 am

For your second question, use waveform~ and you can rig up your own display so that the selection start point and selection end point are maybe just a single line or a few milliseconds apart. Then scroll each at the same time…

Here’s an example of that:

– Pasted Max Patch, click to expand. –

But there are numerous ways of doing this(the way i’ve pasted might be more-than-necessary/convoluted in some ways but hopefully it demonstrates several things you can try).

Using groove~(instead of play~) you could even attach the right-most-outlet of groove~ to the waveform~ (via the number~ box(multiplied by the size of the buffer~)) instead of using line~ to drive everything… just saying, there’s many different ways to do it… hope that helps.


August 4, 2008 | 3:38 am

Wow – thankyou so much!


August 4, 2008 | 3:39 am

On Aug 3, 2008, at 7:36 PM, Richard wrote:
> .When I open a wav file how do I get the filename of the opened wav
> file to appear so I can tell which file I’ve just opened within the
> the patcher window?

> Also…When playings wav files is there a way that you can display
> graphically where abouts in the wav file you are (so you can tell
> when the end is coming up with ease)?

sfinfo~ allows you to do both things.

– Pasted Max Patch, click to expand. –

-C

Chris Muir
cbm@well.com

http://www.xfade.com


August 4, 2008 | 3:44 am

But I’m not using 5.0! Whoops – forgot to mention that.

Isn’t 5 great though? My 30 day trial ran out yesterday. Rats.


August 4, 2008 | 4:01 am

Ok, in that case, just look at the help-file for sfinfo~(or the help-file for info~ if you’re not using sfplay~). They’re both in Max4 as well. I’ll get you a version of these patches for 4 in just a few…


August 4, 2008 | 4:17 am

Here’s that second patch of mine which demonstrated both of your questions in Max4.6:

#P button 163 128 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 163 336 45 196617 set test;
#P window setfont "Sans Serif" 12.;
#P window linecount 2;
#P comment 57 323 94 196620 < - 1.Turn audio on.;
#P user ezdac~ 15 313 59 346 0;
#P window setfont "Sans Serif" 9.;
#P user waveform~ 163 355 200 74 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P window linecount 1;
#P newex 317 272 27 196617 + 5.;
#P user number~ 228 265 267 280 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 15 266 56 196617 play~ test;
#P newex 15 238 32 196617 line~;
#P newex 257 205 27 196617 f;
#P message 15 221 50 196617 0 , $1 $1;
#P window setfont "Sans Serif" 12.;
#P window linecount 2;
#P comment 33 151 135 196620 < - 3. Click to play the sound.;
#P button 6 146 27 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 200 123 62 196617 prepend set;
#P user textedit 200 144 307 163 32896 3 9 beatbase.aif;
#P newex 108 103 105 196617 info~ test;
#P newex 53 83 65 196617 buffer~ test;
#P message 53 47 43 196617 replace;
#P window linecount 3;
#P comment 307 142 100 196617 < -Most recently loaded filename is displayed here.;
#P window setfont "Sans Serif" 12.;
#P window linecount 2;
#P comment 96 46 107 196620 < - 2. Load a soundfile.;
#P fasten 7 0 10 0 11 193 262 193;
#P connect 12 0 16 0;
#P connect 12 0 16 1;
#P connect 11 0 12 0;
#P fasten 11 0 13 0 20 259 233 259;
#P fasten 14 0 15 3 322 322 309 322;
#P connect 13 1 15 2;
#P fasten 13 1 14 0 263 281 300 281 300 265 322 265;
#P connect 19 0 18 0;
#P fasten 4 7 19 0 204 122 168 122;
#P connect 4 7 6 0;
#P connect 18 0 15 0;
#P connect 9 0 11 0;
#P fasten 10 0 9 0 262 226 155 226 155 216 20 216;
#P fasten 4 6 10 1 191 170 279 170;
#P connect 6 0 5 0;
#P connect 2 0 3 0;
#P connect 3 1 4 0;
#P window clipboard copycount 20;


August 4, 2008 | 4:25 am

And here’s Chris Muir’s patch using sfplay~/sfinfo~ for Max 4.6:
#P window setfont "Sans Serif" 14.;
#P window linecount 2;
#P comment 54 298 65 196622 Turn On Audio;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 192 254 41 196617 * 100.;
#P user hslider 192 291 18 128 100 1 0 0;
#P flonum 192 273 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 192 234 27 196617 / 1.;
#P newex 213 210 29 196617 t b f;
#P window linecount 0;
#P message 343 217 105 196617;
#P window linecount 1;
#P newex 343 198 62 196617 prepend set;
#P newex 192 168 70 196617 snapshot~ 10;
#P newex 278 177 79 196617 sfinfo~;
#P message 278 158 104 196617 getnamed my_player;
#P user ezdac~ 118 302 162 335 0;
#P user gain~ 144 164 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 118 164 24 100 158 0 1.071519 7.94321 10.;
#P button 243 132 16 0;
#P window setfont "Sans Serif" 14.;
#P comment 132 106 100 196622 Play;
#P window setfont "Sans Serif" 9.;
#P message 118 106 14 196617 1;
#N sfplay~ 2 120960 1 my_player;
#P newobj 118 132 123 196617 sfplay~ 2 0 1 my_player;
#P newex 51 104 45 196617 t b open;
#P button 51 59 38 0;
#P window setfont "Sans Serif" 14.;
#P comment 90 67 100 196622 Select File;
#P connect 7 1 8 0;
#P fasten 2 1 3 0 91 127 123 127;
#P connect 1 0 2 0;
#P connect 19 0 17 0;
#P connect 16 0 19 0;
#P connect 17 0 18 0;
#P connect 12 0 16 0;
#P connect 15 1 16 1;
#P connect 15 0 16 0;
#P fasten 11 3 15 0 322 200 218 200;
#P connect 13 0 14 0;
#P connect 11 5 13 0;
#P connect 3 2 12 0;
#P fasten 2 0 10 0 56 154 283 154;
#P connect 10 0 11 0;
#P fasten 8 0 9 1 149 294 157 294;
#P connect 7 0 9 0;
#P fasten 3 1 8 0 160 156 149 156;
#P connect 3 0 7 0;
#P connect 3 3 6 0;
#P connect 4 0 3 0;
#P window clipboard copycount 21;


August 4, 2008 | 5:06 am

Cheers that’s great thanks very much!


August 5, 2008 | 10:34 pm

Again, thanks for the patches they worked great. As long as I can reference the tools I can then access the help!

Another quick question, In Max 4.5, is there any way you can zoom like you can in 5.0? It’s incredibly frustrating to have to scroll – I’m using a touch screen, and had shortcuts set up for zoom in/out within the patch.


August 6, 2008 | 12:16 am

Sorry, no, this is one of the new features of Max5(you could use the MacOSX zoom function(for me, setup in my SystemPrefs it’s just ctrl+mouse-scroll or ctrl+trackpad-scroll(two-fingers on trackpad) but maybe that’s what you’re already describing with your touchscreen setup).

Say, you wrote that you’re on Max4.5, you should maybe at least update to 4.6?

http://www.cycling74.com/downloads/max4

Or maybe it was just a typo, just makin’ sure…


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