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.

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

> 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 :)

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.