Page 1 of 1

scaling uniwaveform

Posted: Wed May 04, 2011 8:24 pm
by marc
is there away of scaling the uniwaveform to the length of the audio track that is placed inside it? insted of the waveform filling up the uniwaveform box regardless how long the track is? so if i play a 3 minute track the size of the wave form will be shorter than a 5 minute track? or is there some way of getting the same result?

Posted: Thu May 05, 2011 6:58 am
by dlpinkstah
The uiwaveform object by itself will not do this scaling. However, you can force it to scale the width of its display as you wish using attributes "patching_rect" and/or "presentation_rect".

Send a message to uiwaveform to change the "patching_rect" and/or "presentation_rect" attributes according to the file length. For instance, if your file is 3 minutes you could send the message "patching_rect 10 10 60 20" to place the waveform at location {X, Y} = {10, 10} with width 60 and height 20. If your file is 5 minutes you could then send the message "patching_rect 10 10 100 20" to place the waveform at location {X, Y} = {10, 10} with width 100 and height 20.

Posted: Thu May 05, 2011 8:04 pm
by marc
ok cool thanks. but u would have to force it every time u wanted to rescale it? (manually editing the scale?)
so u couldnt do this on the fly when loading up different length tracks you would have to force the scale between each track to gain the results otherwise the scale would remain same from the previous patching_rect/presentation_rect?

Posted: Fri May 06, 2011 1:54 am
by dlpinkstah
Every time you load a new track, just query the track length from mptcfs_sa~. Then use the track length value to scale the waveform width.

Posted: Sun May 15, 2011 12:42 am
by marc
sorry but i dont know how to do this, how do i add this value for width, in between the xy and height? only changing the width value?

Posted: Fri May 20, 2011 2:08 am
by marc
some help please?

can i use this value coming for the mptcfs~ to automatically scale it (through doing a equation to fit my scaling needs) or does this require physical input each into my application? and when u say query do u literally mean find out the value or is this some kind of function i can do?

many thanks

Posted: Fri May 20, 2011 5:54 am
by dlpinkstah
Use the "message" object to create the message that will then be passed to the uiwaveform object. To modify the width parameter only, use the $1 notation. So create a new "message" object, and type this into it: "patching_rect 10 10 $1 20", or similar. With that, whatever input you put into the message object will cause a message to be output, with the width parameter reflecting the input value. This is extensively covered in the Max/MSP help files for "message" object, and in tutorials. You need to do some homework :wink: It's not really that hard, but does requires some study!

Re: querying: Yes- you pass a message to mptcfs_sa~ "query msec_duration" which will cause the length of the audio file in milliseconds to be output from the rightmost outlet of mptcfs_sa~. You would then scale this value appropriately, and use it as the input to the message object described above, which will then feed the uiwaveform object and cause its width to be modified according to file length.

This should all be very easy to anyone who has done some Max/MSP patching. But if you're very new to patching, then I guess it's like learning a whole new language. But in time you'll find it very easy!
:lol:

Posted: Sun May 22, 2011 3:16 pm
by sec-def
is there a patch illustrating how to do create pop-up wave form?
i've seen some discussions about it and it would be very helpful for me.

Posted: Tue May 24, 2011 7:38 pm
by marc
thanks for that last post on here dlpinkstah really helpful stuff yeh im a bit of a noob just starting out i did lots of homework on all the help files but i can just work a bit better when its explain out to me, i could like see how other were using the function but i didnt quite know how to apply it to my work. =]

another question about scaling!! is it possible to get the quite parts of an audio track to be very short in hight and the louder parts of audio to be taller? like over the top sort of thing, super skinny to extra tall? does that make sense? more defined not like hazy/chunky?

cheers

Posted: Fri Apr 17, 2015 4:27 am
by saboor
For those reading this out of curiosity from other sites, this M4L Pinky device just got much better! The browser thingy in Ms Pinky is completely mappable and works like clip launching with no quantizing. So if you were into that cue point kind of mashing all you need to do is cut each track where you want it to begin and load them into the Folder the patch uses to read files, map your buttons to the tracks or "cues" and mash it up! and of course scratch.