[share] how to delete clips with M4L

Learn about building and using Max for Live devices.
ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

[share] how to delete clips with M4L

Post by ring (Simon Slowik) » Tue Jan 12, 2010 6:14 pm

I don't know whether anybody is interested, but I've found a proper way to delete clips with M4L:

(I don't know how to post patchers so I just describe it...)

- I focus the application view to session and scroll one up (in order to focus the clips instead of tracks).
- Then I set the highlighted_clip_slot property of live_set
- and finally I use an external that I've written called keyPress. It emulates the key stroke of a given key event.
After 10 ms I send a "38", wich means backspace - that deletes the clip.

I'd share it if someone could need it.

olivierseb
Posts: 230
Joined: Sun Dec 11, 2005 8:52 pm
Location: FRANCE
Contact:

Re: [share] how to delete clips with M4L

Post by olivierseb » Wed Jan 13, 2010 7:34 pm

ring wrote:I don't know whether anybody is interested, but I've found a proper way to delete clips with M4L:

(I don't know how to post patchers so I just describe it...)

- I focus the application view to session and scroll one up (in order to focus the clips instead of tracks).
- Then I set the highlighted_clip_slot property of live_set
- and finally I use an external that I've written called keyPress. It emulates the key stroke of a given key event.
After 10 ms I send a "38", wich means backspace - that deletes the clip.

I'd share it if someone could need it.
hi
very interesting,

a while ago we figured that we could use remote keystroke to do what the API doesn't, but we had to find a way to select the clip to delete.

what's the difference between your external the [aka.keyboard] ?

thanks for sharing

olivier
Image

MacBookPro17", mac OS 10.6.2/RME FF400 & FF800
http://www.olivierseb.com

Max for Live training sessions in Paris @
http://www.apaxxdesigns.com/

Max for Live training sessions in Rennes @
http://www.intouchmedia.fr

ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

Re: [share] how to delete clips with M4L

Post by ring (Simon Slowik) » Thu Jan 14, 2010 12:07 am

olivierseb wrote: a while ago we figured that we could use remote keystroke to do what the API doesn't, but we had to find a way to select the clip to delete.
So I hope I did show you the way. Or was that a question?
olivierseb wrote: what's the difference between your external the [aka.keyboard] ?
I'm on windows and I think [aka.keyboards] is for mac only, isn't it?! Besides I made it myself :)

olivierseb
Posts: 230
Joined: Sun Dec 11, 2005 8:52 pm
Location: FRANCE
Contact:

Re: [share] how to delete clips with M4L

Post by olivierseb » Thu Jan 14, 2010 6:34 am

ring wrote:
olivierseb wrote: a while ago we figured that we could use remote keystroke to do what the API doesn't, but we had to find a way to select the clip to delete.
So I hope I did show you the way. Or was that a question?
olivierseb wrote: what's the difference between your external the [aka.keyboard] ?
I'm on windows and I think [aka.keyboards] is for mac only, isn't it?! Besides I made it myself :)
yes afair aka. Is mac only
so it is a good news for pc users.
Yes you showed the way :-)

thanks a lot

olivier
Image

MacBookPro17", mac OS 10.6.2/RME FF400 & FF800
http://www.olivierseb.com

Max for Live training sessions in Paris @
http://www.apaxxdesigns.com/

Max for Live training sessions in Rennes @
http://www.intouchmedia.fr

julienb
Posts: 1815
Joined: Sat Oct 29, 2005 1:15 pm
Location: France
Contact:

Re: [share] how to delete clips with M4L

Post by julienb » Thu Jan 14, 2010 10:34 am

ring wrote:I don't know whether anybody is interested, but I've found a proper way to delete clips with M4L:

(I don't know how to post patchers so I just describe it...)

- I focus the application view to session and scroll one up (in order to focus the clips instead of tracks).
- Then I set the highlighted_clip_slot property of live_set
- and finally I use an external that I've written called keyPress. It emulates the key stroke of a given key event.
After 10 ms I send a "38", wich means backspace - that deletes the clip.

I'd share it if someone could need it.
genius way :)
I won't use it, but I guess a lot wanted that :D
Julien Bayle
____________________________________________________________________________________________________

art + teaching/consulting
ableton certified trainer
____________________________________________________________________________________________________

pau cabruja
Posts: 38
Joined: Sun Jan 09, 2005 9:01 pm
Location: girona
Contact:

Re: [share] how to delete clips with M4L

Post by pau cabruja » Thu Jan 14, 2010 11:44 am

Hi ring, i'm interested!
can you send it at: pauk at pauk dot org ?
And you can upload it in maxforlive.com as well

Thanks!

halley
Posts: 40
Joined: Sun Jun 28, 2009 8:48 am

Re: [share] how to delete clips with M4L

Post by halley » Thu Jan 14, 2010 1:05 pm

Emulating Keystrokes can give much more power than simply deleting clips!
Think about just the possibility to add Midi, Audio or Return tracks...
or take a look of what you can do with nativekontrol's bome scripts...

Just the other day I was thinking at how to send keystrokes to Live
and sadly discovered that aka.keyboard is indeed a Mac only Max External.
I have no idea on how to write an external for Max but it seems that several
language can be used for the purpose. C/C++ are the ones normally
offering the best overall performance but I guessed that if you write a
keystroke emulator object in these languages you surely have to write
platform-specific modules first and then eventually a cross-platform wrapper
object around them... so maybe java is the way to go since somebody should have
already dealt with the low-level platform-specific issues inside java's virtual machine.
then today I open ableton forums and ta-da!!!

@ring
is there any chance:
- you are uploading it on some site like maxobjects.com or maxforlive.com? (as pau_cabruja already suggested)
- you are willing to release it as open source? uploading it to some site like google code or similar.
anyway... thanks!


@julienb
sure a lot want that.
even with M4L, on windows you still have to pass through softwares like Bome to have some keystroke-only functions.
I have Bome Midi Translator and I found it simple and straightforward for a lot of stuff,
even when you own a powerful environment like Max it can sometimes be useful for prototyping,
but still... it's surely more elegant and compact if you can manage everything inside Live-M4L.

ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

Re: [share] how to delete clips with M4L

Post by ring (Simon Slowik) » Sat Jan 16, 2010 11:45 am

here we go:

I uploaded the M4L-device on maxforlive.com (deleteClip) and the java external on maxobjects.com (ring_keyPress).

Please tell me whether it works!

halley
Posts: 40
Joined: Sun Jun 28, 2009 8:48 am

Re: [share] how to delete clips with M4L

Post by halley » Sun Jan 17, 2010 1:59 am

I was just looking into java's awt Robot class...
is it the same one you used in ring_keyPress?

Thanks for uploading both the class and the example amxd
I've just tried a couple of shortcuts and it seems to work.
It seems very responsive too, anyway I want to find some
time to make some more heavy tests in the next weeks.

Interesting thing was to discover that using java classes
isn't so complex as I thought it would be. It really seems
more straightforward than javascript, at least to me.

Thanks again
cheers

ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

Re: [share] how to delete clips with M4L

Post by ring (Simon Slowik) » Sun Jan 17, 2010 2:12 am

halley wrote:I was just looking into java's awt Robot class...
is it the same one you used in ring_keyPress?
Yes, it is.
halley wrote: Interesting thing was to discover that using java classes
isn't so complex as I thought it would be. It really seems
more straightforward than javascript, at least to me.
That's what I found, too.
It was my first time I wrote something in java and its pretty easy to handle.

tomatoe_joe
Posts: 25
Joined: Sun Mar 08, 2009 4:31 pm

Re: [share] how to delete clips with M4L

Post by tomatoe_joe » Sun Jan 17, 2010 7:06 pm

ring, this is Awesome! Thanks!

For those of you (like me) who don't know anything about javascript, don't forget to paste the ring_keyPress.class file to:
C:\Program Files\Cycling '74\Max 5.0\Cycling '74\java\classes

And for whatever it's worth, this slight modification of ring's genius patch works a bit better for me:

<pre><code>
----------begin_max5_patcher----------
1369.3oc0as0aqhCD94To9evhmyFgs4RXea28OvJsOVcTDAbS7oN.BbR6YOZ
+uu9BPwoPhSxIUtUpTvWvy7MW7v3o+7wGl4st7MRiG32AOAlM6mhVloZS1xr
tFl4sK8sLVZiZfdEjWKW+cu4s8wIuwUsWAxILBm7WLZUeuUo7rszhMqpIYb8
5fwKBmCVhV3OGDEIuGtbgO3acSoX+NZg3EoVM3fVK2y6Z1uq4mKK3Eo6HJJ3
OpooLveVxx6WeZtpGAA+aXugSpg9upIA8W3aPrj5Vlui6EimxHGH0Mzxhgzz
LOClRvNwpqI3PEuEDOfsDv5FVY1Kj7gz+LubxyWzaorhT79DjDu4kiFJsnpl
zPJ3o7Vp2XoS2y3qLfCzhwGvyoYjomtoHvqeLapo4kERBwbtx16Vxm.PEmJu
Nf5UCoHsZroyKKYqSqOPanqYDSYhP6MsftKkS3TMQg7eelzcU0zBt4qiTjJd
MaaxpKYLy2ltqCi0UN4.Mi7JMmuU85F.bFVUCUkLrtL63jVYlVZBjWnkNrqQ
LyB8klVnv.I1hSTH7P6ros0FwdynqyXyo08Tyk+ipVQrmm4BOvtLx26329Pi
y9t9uGen6dwsyuKHKultYCoFrFvrCegIAZqzaCeQ2L9tNsXi27SgygIeIwYT
RnDnwnjuL.cj6.zV4pnEhCfZHVcE4em7UbstIBwSipn6.ptizzjtgLNrtzVH
MPAlXz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+WAbD.pmtYp4ZAziMP5f0OZXXl
CgIrJL8LOhAwDFCCo0GeP7m+GlSMvrC
-----------end_max5_patcher-----------
</code></pre>

ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

Re: [share] how to delete clips with M4L

Post by ring (Simon Slowik) » Sun Jan 17, 2010 8:31 pm

I had to modify my patch a little bit, cause sometimes it didn't work. I put some 10ms-delays in it to give ableton the time to change its view :)

What else I've done: You know the launchpad?
Of course you can record and start/stop clips within the session view.
In my new patcher now the first arrow button on the right (but also could be any other button) works as a shift button. If you hold it and then press a clip button, the certain clip will be deleted.

So that's just one way of using it...

Markemark
Posts: 250
Joined: Mon Jun 22, 2009 3:51 pm

Re: [share] how to delete clips with M4L

Post by Markemark » Fri Jan 22, 2010 5:12 am

ring wrote:I had to modify my patch a little bit, cause sometimes it didn't work. I put some 10ms-delays in it to give ableton the time to change its view :)

What else I've done: You know the launchpad?
Of course you can record and start/stop clips within the session view.
In my new patcher now the first arrow button on the right (but also could be any other button) works as a shift button. If you hold it and then press a clip button, the certain clip will be deleted.

So that's just one way of using it...
If you could upload that patch to maxforlive.com or here that would be great. I'd like to adapt it to shift delete clips on the apc40. Thank you for your efforts Ring.

ring (Simon Slowik)
Posts: 121
Joined: Fri Oct 30, 2009 3:35 pm

Re: [share] how to delete clips with M4L

Post by ring (Simon Slowik) » Fri Jan 22, 2010 11:19 am

Oh, I already did. The Patch on maxforlive has already version 1.1, so you can download it. You don't need to adapt anything, just give a clip_slot_ID and a bang to the subpatcher and it's gonna be deleted.
Simply route the knobs of your APC to the bang...

benb7760
Posts: 8
Joined: Mon Nov 23, 2009 1:00 pm

Re: [share] how to delete clips with M4L

Post by benb7760 » Mon Jan 25, 2010 3:11 am

out of curiosity, does this workaround work when the live window is not highlighted? the patches I am working on will require a max window on top of all other applications, and i'd much rather not having to bring live to the front before I can delete a clip

Post Reply