The Definitive Live Autohotkeys script!

Discussion of music production, audio, equipment and any related topics, either with or without Ableton Live
Josh Von
Posts: 253
Joined: Thu Feb 17, 2005 2:38 pm

Post by Josh Von » Thu Jan 04, 2007 11:31 am

*bounce*

Anybody tackle this?

.

MrYellow
Posts: 1887
Joined: Mon Dec 15, 2003 7:10 am
Contact:

Post by MrYellow » Sun Jan 07, 2007 7:22 am

What's this line all about?

Code: Select all

ImageSearch, ClipBraceStartX, ClipBraceStartY, 87, 594, 1017, 615, *55 C:\Documents and Settings\Eoin\My Documents\Music Files\Eoin Library\Autohotkeys stuff\Clipbrace start - unselected.jpg 
Searches the screen for a bitmap? Do we need that bitmap?

Does any of this break L6?

-Ben

rozling
Posts: 1759
Joined: Mon May 30, 2005 9:48 am
Location: Dublin, Ireland

Post by rozling » Fri Jan 12, 2007 11:12 am

Apologies, I was away for a few months and was somehow unsubscribed to this thread & didn't see the replies... anyhoo it seems I prematurely posted my efforts to automate the clip brace. I had worked on it for a while and gave up. MrYellow, it does reference bitmaps, which are screenshots of the clip brace itself.

I'm convinced that the best way to automate complex stuff like this in a performance situation is to get the script to look at the screen just as we would before making a judgement on where to click. This was my first attempt at referencing images - if I/we can figure out how to do it effectively there's a lot of cool stuff we can automate in Live.

Here is a .rar with the images. Note, however, that I work with the Metal skin (which is still available in Live 6) so you'll need to switch to that for testing, or else take your screenshots. It's pretty easy to make those .jpgs - I did it in a couple of minutes using Irfanview.

I haven't really used the script with Live 6 yet but I can't imagine a few random clicks would break it. If things start getting wierd press the 'pause' button on your keyboard, or failing that just kill the Autohotkeys process.

Hmm, just realised the loop brace looks different in 6. That could cause probs but don't have time to check it out now as I'm heading off for the weekend.

Hope this helps/encourages!

Roz

MrYellow
Posts: 1887
Joined: Mon Dec 15, 2003 7:10 am
Contact:

Post by MrYellow » Fri Jan 12, 2007 11:52 am

Does that scan of the screen take time and freeze stuff?

Used a screen scanning/clicking prog once which had to take a complete
screenshot to scan just a section. Would freeze the screen for half a sec or
so.

-Ben

rozling
Posts: 1759
Joined: Mon May 30, 2005 9:48 am
Location: Dublin, Ireland

Post by rozling » Sun Jan 14, 2007 6:53 pm

Shouldn't make a difference, no. Autohotkeys lets you scan only a specific area of the screen, defined in pixels.

These little subroutines are inactive until you press the key combination which invokes them - then it does its screen-scanning thing. If it causes any trouble for you simply don't use the key command or remove it from the script if you like.

Roz

SubQ
Posts: 531
Joined: Mon Apr 17, 2006 1:47 pm
Location: Sao Paulo-Recife-Brasil
Contact:

Post by SubQ » Fri Jan 26, 2007 12:56 pm

Rozling, can we highlight devices for instant mapping with autohotkeys?
cheers
http://soundcloud.com/coelho
Dave Smith Prophet 08 SE, Genelecs, RME Multiface, Faderfoxes, Doepfer Drehbank, Padkontrol, DIY Footcontroller, Electro Harmonix Pedals.

Michael Hatsis
Posts: 1807
Joined: Tue Nov 16, 2004 6:27 pm
Location: Here and There
Contact:

Post by Michael Hatsis » Fri Jan 26, 2007 2:03 pm

SubQ wrote:Rozling, can we highlight devices for instant mapping with autohotkeys?
cheers
Yes you can, dont know if this script does it but i have made a very simple script that selects devices ( for me sometimes the alt+ down doesnt work properly ) and a few other things like select sample display editor It basically tells the pointer to move to a certain point on the screen and click there. Ill send it your way but youll probably have to edit it a bit because its based on screen size- but its very simple to understand. shouldnt take you more than 15 minutes to get it working with your setup.

Meef Chaloin
Posts: 2164
Joined: Thu Jul 21, 2005 10:09 pm

Post by Meef Chaloin » Fri Jan 26, 2007 2:14 pm

could you post that here Mike, I might try this out

SubQ
Posts: 531
Joined: Mon Apr 17, 2006 1:47 pm
Location: Sao Paulo-Recife-Brasil
Contact:

Post by SubQ » Fri Jan 26, 2007 2:39 pm

Yes you can, dont know if this script does it but i have made a very simple script that selects devices ( for me sometimes the alt+ down doesnt work properly ) and a few other things like select sample display editor It basically tells the pointer to move to a certain point on the screen and click there. Ill send it your way but youll probably have to edit it a bit because its based on screen size- but its very simple to understand. shouldnt take you more than 15 minutes to get it working with your setup
Brilliant, Mike. So if i'm getting this right, you're using one key to get the mouse pointer were you want - say a device. Right?

Now here´s the thing: I want to use midi controller buttons or rotaries to do this - my foxes are sitting on the notebooks qwerty, and I don't want to expand my setup. I imagine this is possible trough Bome's, assigning a income midi message to a sequence of keys, or to a autohotkey script. Am I at the right direction here?

thanks to all again.
http://soundcloud.com/coelho
Dave Smith Prophet 08 SE, Genelecs, RME Multiface, Faderfoxes, Doepfer Drehbank, Padkontrol, DIY Footcontroller, Electro Harmonix Pedals.

stutter
Posts: 488
Joined: Tue Sep 05, 2006 3:58 pm

Post by stutter » Fri Jan 26, 2007 4:21 pm

I've done it slightly differently, using a string of key-presses - I'll post what I have in the next post. Only problem is when you have clip brace selected - should be easy to overcome, just haven't had time to sort it out yet. This method should avoid your mouse click hitting something you don't want it to, although I imagine with the mouseclik you could easily find a way of avoiding that.
Anyway, just copy the next post into an autohotkeys script and have a go - important to notice that the numpad keys I've used are available only when Numlock is off - did this so that I could still use it for typing in numbers

SubQ - you could easily use Bome's to translate a midi note from a button into a keystroke

...

stutter
Posts: 488
Joined: Tue Sep 05, 2006 3:58 pm

Post by stutter » Fri Jan 26, 2007 4:21 pm

;SETTING FOCUS

NumpadIns::
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
{
Send, !{Down
}!{Down}!{Down}!{Down}!{Down}!{Down}
}
return
; Focus on clip details - NEEDS Making compatible with CLIP BRACE


NumpadDel::
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
{
Send, !{Up}!{Left}
}
return
; Focus on browser


NumpadEnd::
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
{
Send, !{Right}!{Up 3}!{Down}
}
return
; Focus on clip slot


NumpadDown::
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
{
Send, !{Right}!{Up 3}
}
return
; Focus on track title

NumpadPgDn::
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
{
Send, !{Right}!{Up 3}!{Down 2}
}
return
; Focus on Overview, not sure for what use

stutter
Posts: 488
Joined: Tue Sep 05, 2006 3:58 pm

Post by stutter » Fri Jan 26, 2007 4:23 pm

could've sworn this thread was in the tips and tricks section the last time I looked

SubQ
Posts: 531
Joined: Mon Apr 17, 2006 1:47 pm
Location: Sao Paulo-Recife-Brasil
Contact:

Post by SubQ » Fri Jan 26, 2007 5:27 pm

thnks stutter. I'll try you script later.
http://soundcloud.com/coelho
Dave Smith Prophet 08 SE, Genelecs, RME Multiface, Faderfoxes, Doepfer Drehbank, Padkontrol, DIY Footcontroller, Electro Harmonix Pedals.

drb
Posts: 302
Joined: Thu Mar 02, 2006 9:09 pm

Post by drb » Sun Feb 04, 2007 2:44 am

Here's a script I wrote tonight.. A bit messy, but handy.

;--------------------------------------------------------------------------
;EXPAND EDIT WINDOW WITH A KEY TO TOGGLE LARGE/SMALL
;script by db@skylab2000.com - please email fixes & improvements v.1
;
;window must initially be in default small edit size to use this toggle key
;don't resize manually - only use this toggle key so the script knows where the windows was resized to.
;
;
#IfWinActive, ahk_class Afx:00400000:0:00000000:01900015:00000000
;
;define vars
f9:: ; choose key to redefine (this is f9, which was record key)
wheight = 125 ; top row # of window size desired - approx 125 -700 are 'legal'
;
;
if window = closed ; test window state
{
;open window
MouseGetPos, xpos, ypos ; get mouse position
MouseClickDrag, L, 200, 759, 200, wheight ; open window to size defined in wheight above
MouseMove, xpos, ypos, 0 ; return mouse to where it was
MsgBox, 0,, window was just expanded, .5 ; display window state for testing
window = open ; update window status variable
return
}
else
{
;close window
MouseGetPos, xpos, ypos ; get mouse position
MouseClickDrag, L, 200, wheight, 200, 759 ; close window to normal
MouseMove, xpos, ypos, 0 ; return mouse to where it was
msgbox, 0,, window was just contracted, .5 ; display window state for testing
window = closed ; update window status variable
}
return
;--------------------------------------------------------------------------

EDIT: My script moves cursor to the spot where it then drags the window up. I'd assume that in diff screen resolutions it may not work. I'm at 1280*1024. You'd need to change coordinate to proper screen locations if it doesn't function on your machine.
Last edited by drb on Wed Feb 07, 2007 12:24 pm, edited 1 time in total.

SubQ
Posts: 531
Joined: Mon Apr 17, 2006 1:47 pm
Location: Sao Paulo-Recife-Brasil
Contact:

Post by SubQ » Mon Feb 05, 2007 1:31 pm

Adapted from Mike's Browser select script, with following shortcut features:

Undo - u
Redo - i (the only one wich doesn't seem to work, dunno why)
Remove Stop Button - o
Toggle Pen Mode - p
Toggle Track, Clip View - t
Duplicate -d
Sixteen Note QUantization - 6
Eight Note Quantization - 7
Quarter Note Quantization - 8
1 Bar Quantization - 0
From Session To Browser - b
From Browser to Devices -n
From Devices To Session - m (sometimes you must hit m twice to go up to session slots)


;This script is made for a 17 inch widescreen monitor at 1440 x 900 Pixels
;at full screen ( F11 ). You will probably have to modify it if
;you are using a different resolution.
;
;

GroupAdd, Live, ahk_class Afx:00400000:0:00000000:01900015:00000000
GroupAdd, Live, ahk_class Afx:00400000:0:00000000:01900015:02BB05FD
GroupAdd, Live, ahk_class Afx:00400000:0:00000000:01900015:02FF0351
curMode := 1
return


#IfWinActive, ahk_group Live
{



CoordMode,Mouse,Relative
;Browser
;open browser
2::Click 21,91
;select Lives devices
1::Click 21,116
;Select vst devices
q::Click 21,139
;select File browser 1
a::Click 21,163
;select File browser 2
z::Click 21,187
;select File browser 3
x::Click 21,211

;to session
f::Click 482,93
Shift::Click 482,102

;To Devices
;select device
Space::Click 36,717

;To Undo
u::^z

;To Redo
i::^+z

;Remove Stop Button
o::^e

;Toggle Pen Mode
p::^b

;Toggle Track, Clip View
t::+Tab

;To Duplicate
d::^d

;Sixteen Note QUantization
6::^6

;Eight Note Quantization
7::^7

;Quarter Note Quantization
8::^8

;1 Bar Quantization
0::^0

;From Session To Browser
b::!Left

;From Browser to Devices
n::!Down

;From Devices To Session
m::!Up
}


cheers
coelho
http://soundcloud.com/coelho
Dave Smith Prophet 08 SE, Genelecs, RME Multiface, Faderfoxes, Doepfer Drehbank, Padkontrol, DIY Footcontroller, Electro Harmonix Pedals.

Post Reply