Waveform~ question

Feb 16, 2009 at 3:16am

Waveform~ question

Is there a way to drag the waveform~ selection with the mouse, and have it only affect the start position, and not the width? I’ve tried doing it with the selectionstart and selectionend inputs, but it often ends up sending one before the other (ever so slightly) and it gets glitchy.

#42322
Feb 16, 2009 at 11:51am

I would do it like this:

- set mouse mode to 0
- get the mouse position from the mousestate outlet
- translate it to the actual position in the buffer using the display start and end values

selection end is changed only as soon as selection start becomes higher than the current selection end

– Pasted Max Patch, click to expand. –
#151474
Feb 16, 2009 at 12:03pm

I guess I didn’t explain it clearly – what you put together does actually do what I said, but it’s not what I meant >.<

I’d like to be able to define a selection width of value Z, and move the selection around with the mouse, without affecting the selection width at all. Sort of like a wide scrub?

Turns out what I needed it for wasn’t working well anyway, so I’ve scrapped that line of reasoning (I’ve gone through about 12 today…) I’ve basically been reduced to removing display functions from this tool I’m building, because it just causes too many slowdowns. :/

Thanks though!

This works for what I want (ugly though)

———-begin_max5_patcher———-
1709.3oc6ZssiiZCF95LOEVQ8tlIxmAV0a5yQU0HB3LCcIPDPlL6tp6yd8AH
CjXRHDHgUpql0.NF3ye+ms4GOMa9pzOD4yAeA7WfYy9wSylo6R0wrxqmMei+
GAw945gMOQrOc0+Leg4mJDeTn6t.rBDU0aTntO43dFyp5bcZRQdz2EpeBgWB
K6NcWQrnn3aaEFTLekexqyW.lGkHex+c4n15WD7VTxqujIBJLCjwXxGBf.g5
C3krE.r77C2i5El3uQ+bm+mYQ9wUPIY2lnD4aUOiPe1oAK5dwpN+2mdR0r31
nlmAvk1XF50xLqiS86FmPtQNAakSP8fSjXV9PrM8wVm9nkLOFx047bvhR0jy
xEHCIv0GX51FbwaJITPZbZl4FfKccfLW2EVOC0eMqhrn7.+X8vgK8rquUMQx
D4hjB+hnzjFSF5RjKyygplQzkLGWpGp4zpOZr61rRjYS5ftVkSk4ZWDKXiXg
RXsHVtMy1ySiXDy7x4pCvxl9Qc1M1+c6F6HxvarWwjP1TwXOHcyFgRO3HRIW
DKQsTT.1GEV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45ieJNZ3NU5Fi
6JQoBdbFzSGHhWB65fM1ekH9nakeX5Ic5AYd5fXJWfrK5Xt7CxAwMkG5ouxq
dl8uqeiMitEE70M9YesAHnXBCqe0mdVcPbTH3C8GDGsMLye+wuH8a10lRGqr
yCaXcSY9hFMrVhCvGvDuyD9g.ePtr.rPv5nX0VFVjVtIX+z1FMC6c8XF29XX
sPAO1DwaO3nensot23EYjpS1fLhKUn9Ipq19nOGOMpT82jojpDYAUygpuzNv
m.KTjWDknSAr9fnMFzmKTUkWpMQgaSk5X4U1RVkaWElPcASn6FlT0LbYdhcW
4I1TT1Q6Blv2WLg5.lX2WYm5S65x7D5thIUxK.7EvzQ.erwjSGnIMjtetBTQ
LtHl37VnIzCTz4d+wD4RXx49hotnOwuy7DuCg63N2WWAromNdmBAejgvjHD7
QFBiMlHcID70pOo9rYUUwAIpCDY1rUWcqABc6Rv46qlFx4VRXXjvDe5YQhtE
Q2Hkq2zKUOuaIjSKPhvLliluWY0pmUc0PDzldof1v6atxvtjD3CHW4Ngoqvw
eobj.0dWcHnkXOOO0V.o6ZHfLpKPl1cHSkg.bfPHBq.IRiaJaomrKLsrqaU7
OFtY3tNZp174n3BwKcN8RD1rAdluiR8U2iXyd8JzrqwU.6vEMfp7h+8o+CXv
SJYF
———–end_max5_patcher———–

#151475
Feb 18, 2009 at 11:08pm

#151476
Feb 19, 2009 at 3:26am

> I’d like to be able to define a selection width of value Z, and move the selection around with the mouse, without affecting the selection width at all. Sort of like a wide scrub?
>

A couple of ways: set a grid size (I use ms. so if you want that then set it in the waveform~ inspector, beats/samples are also possible). Set snap to grid. Then your selection will never be less than that, or if it’s bigger, it will be an integer multiple of that (2 beats, 3, 8, etc.)

Or use the Loop tool to move around instead of the select. With shift held down the size will not change (but if you have snap to grid or snap to zero-crossings on, this will override). Without shift you can size the width by moving in the Y direction as well. The select and move tools also function differently with shift held down, check them out :)

#151477
Feb 19, 2009 at 5:01am

I didn’t know about the shift function of the loop tool – is there any way to make it act like that programatically? I have a secondary mode that I’d like to pass mouse commands to, and the waveform needs to function differently when in that mode (normal mode, the loop tool functions normally. The secondary mode, horizontal on the mouse changes a pitch value, and so I don’t want the loop tool to change the size of the selection in that modem but I don’t want to have to make my users hold down the shift key, either.

#151478

You must be logged in to reply to this topic.