I made some scripts to create devices by typing their names only (and sometimes not even that)

This forum is for discussing Reason. Questions, answers, ideas, and opinions... all apply.
Post Reply
User avatar
Seckin
Posts: 120
Joined: 09 Apr 2016

19 May 2020

OK, firstly the idea was totally inspired by ebai101's post:
viewtopic.php?f=4&t=7517718.

I don't have a Mac so I don't know what his macro exactly does or what it looks like, but thanks to him I was inspired by the idea so I made three little scripts that work on PC, built on the good old little freeware Autohotkey.

The three scripts are attached in the Winrar file in this post.

Here is what each one does:

Edit: By the way the devices in the videos are just examples. You can create any device.

1st script: “Type for Device v1”



Two notes on the first script:

1. you will probably have to modify (very easy to do) the script to teach it where to click on your screen, depending on your monitor size and screen resolution because that might be different than mine. No coding knowledge required whatsoever and you only have to do it once and below is how to do it. If you don't want to read about how to do it, just skip to the video for the 2nd script. Oh and the 2nd script exists because of a potential problem with the 1st script and that problem is described in the 2nd note on the 1st script below, so maybe the 2nd video would make more sense if you read that part first though, just saying.)

Here is how:

Install Autohotkey first (required to run the scripts as well). Autohotkey comes with a little app called Window Spy. Use the Windows search box to find and run it. Make sure you are using Reason on full screen. Then right click on the script file and click Edit Script.

In the script, “Click 12, 91” is the location where the logo for the “Instruments” title is found on my Reason Browser. “Click” tells the script to click there. Point your mouse over yours and Window Spy will show the location of the logo for your PC, under “Mouse Position”. You want to keep your mouse right on the middle of the logo so that your script will work even when your Browser is on its minimum size, like in my video above. You don’t want it to depend on the word “Instruments” instead, because then it won’t work if you’re not using the browser in the expanded mode.So the numbers you want are in Client or Window lines under “Mouse Position” (both would work). You just have to change my 12, 191 with the numbers you see there.

The Next line, “Click 56, 143” on my script is where my Search bar is on my Reason browser. Once again, change the numbers accordingly. Make sure that you’re towards the left of the Search bar.

You will see that “Click 56, 143” is same for all four commands (1::, 2::, 3::, 4:: ) (device types) because the Search bar’s location never changes. The 2nd command will use the position for your Effects logo, the 3rd for your Utilities logo and the 4th for your Players logo. That’s it. Change the locations in the code accordingly.

Second note on the1st script: The “sleep, 1000” and “sleep, 500” are wait times. Like when the line above “sleep, 1000” activates the search bar, the script waits for 1000 milliseconds for you to type the device name. That’s 1 second. It then double clicks on the first result found. You can modify the waiting time, but I found that it’s long enough to type any device name. “Sleep, 500” on the other hand is the half second that I gave Reason to display the device in the search results after it is searched. You can modify it, for instance if your computer is faster than mine you can decrease it. You should do an efficient search so that the relevant result must be displayed right at the top of all results because the next line, as “Click 182, 190, 2” command double clicks on it. You can modify that one’s location as well.

So, this arises a problem about the 1st script: Because of the waiting time, if you make even a minor mistake in typing the device name, you may get a wrong device. immediately If you type nothing or are late to type, you will get a wrong device definitely. You can give the script some extra waiting time, but then maybe you won’t like to wait that long to load a device. While I think this method has a very flat learning curve, like, after a few sessions it will become very hard to type a wrong name, some people would rather not have the waiting time. If you’re one of those, proceed to the 2nd script.

2nd script: “Type for Device v2”



That’s about it. No waiting time here, so you possibly can’t go wrong.

And finally,
3rd script: “Device Hotkeys”



Notes on the 3rd script:

So you can do this for all your favorite devices. Theoretically infinite number of them. Inspect the script code and you’ll find it’s easy to modify. The numbers on where to click are basically the same. The only difference is the third line. That’s the input that the script types into the Search bar. Make sure to write a name that will not get confused for any other device. Also don’t forget that “1::” is for instruments, “2::” is for effects, “3::” is for utilities and “4::” is for players. So if you want to add a fifth hotkey, for let’s say, Thor that will be loaded when you press 5, just copy and paste the code from “1::” (because Thor is an instrument and 1:: is the instrument one due to where it clicks) to the bottom of the script (don't forget to include the “return” line at the end), change the hotkey to "5::" and change the “send +europa” to “send +thor”. That’s it. Now if you press 5, Reason will load a Thor. If you want to, let's say, press Ctrl+9 to load Thor, you must change the hotkey to ^9:: instead of 5::

Here is a list on how to define various hotkeys in Autohotkey:
(In other words, what to type in if you want an Alt+6 or Alt+Shift+I as a hotkey)

https://www.autohotkey.com/docs/Hotkeys.htm

Things to note in general:
1) These scripts only work when Reason is the active window on your PC so that it won’t mess up with your general PC usage (you can still use the number 1 in a calculator)

2) The scripts don’t allow you to choose where you load an instrument. Drag and drop feature is your only friend for that, but you can drag it after you load it too. On the other hand for effects, utilities and players, you get to choose where you load them. In fact for players, you have to choose a location first otherwise it won’t get created.

3) The scripts, in their current form, use the numbers 1, 2, 3, 4 and “ on your keyboard (not the numpad numbers, the ones that sit above the letters). This cancels any other function for them. In Reason, the numbers are by default assigned to the velocity settings for the on-screen piano keys. Running these script means you won’t be able to use that feature in Reason but I think that's disposable for like a vast majority of the people here. Also, you can assign any key you like to these scripts as long as it’s either not assigned to a feature in Reason or not assigned to a crucial feature in Reason. You can check the manuals to see what keys are available.

Oh and finally, in order the run a script, just extract it from the windrar wherever you like and double click on it. If you make a modification on it, don't forget to right click its icon on the taskbar and reload it.

That's all. I hope someone out there finds this useful. Regards!
Attachments
Device Loading Scripts.rar
(1.3 KiB) Downloaded 41 times
If you can't make a hit with Malstrom, Subtractor and Redrum, you can't make a hit at all.

User avatar
ravisoni
Posts: 424
Joined: 09 Feb 2015
Location: Las Vegas

19 May 2020

Good on you for having figured this out! Autohotkey is amazing when used correctly!
:reason: Reason 12 | :re: Preset Browser | :refill: Refill Hoarder

User avatar
mcatalao
Competition Winner
Posts: 1830
Joined: 17 Jan 2015

19 May 2020

Hey nice to see somebody using ahk with reason. I really like ahk, it is great for pretty much everything automation. I've even used it at my job to create an automation tool for a client where he used windows applications.

I use it too, but to a "little" more aggressive extent. I have a HUGE 2000+ line script sniffing several parts of reason for stuff that really was quite cumbersome without it. But coding like that is fiddly, and you have to rely on image scans, and time some stuff.

Anyway, just so you have the idea of what i already tweaked, first, i have my script on a loop to find a mixer solo channel and select it. The need for this script is so that from my mixers i can select and control the channel i'm working on without even touching the mouse or keyboard.
The script can select channels from up to more than 64 mixer channels and devices.

The same loop also scans the mixer window to find the base channel position, and positions it in the beginning of my mixing screen. It also checks for a control track because it has to "know" when to stop. But say, if i'm controlling channel 1-24 of my mixer and go to channels 17-32, the script "senses" the base channel indicator is not in the beginning of the monitor and positions it with the horizontal scroll.

I also created stuff similar to yours but i don't create devices, i use it to streamline the additions of processing chains. For example, if i'm tweaking a vocal, i press ctrl+alt+1 and it puts a vocal chain in the selected channel. And my BCR2000, with the focus on that channel now can control the whole channel and the 8 insert controls (4 buttons and 4 knobs) for that channel, that i previously configured.
So i have these chains mapped from 1 to 0 in the keyboard. Vocals, drums, bass, keys, etc.

I have another function that exports my song between locators, but removes dither, because i always use isotop dither, saves the file with the timestamp, then converts the song to mp3 with lame encoder (i still don't use reason's mp3 export because with my process i export a wave and an mp3), then gets my clients email from the song info and finaly sends it by mail to my client (neat right??? ).

I have another function, that navigates the project using Blocks as locators.
And i have another function, that expands different sections of the mixer, so i can focus only on the dynamics section, the eq, the sends, the inserts, and so on.

Finally i have a auto save script that runs in paralalel and auto saves up to 3 versions of the active song. I disabled this script because it was a bit too obtrusive.

What i like in autohotkey is no matter what your workflow is (for example i'm more a patch guy, so i wouldn't work well with for example adding a device, or something as you have now) but in my case, i needed to streamline a bunch of aspects of my mix.

IF you're into seeing what i'm doing, you can check out this video where i pretty much explain what my ahk script already does:


As i say in the video... I can mix a song almost from start to end without touching my mouse, and i only go to the keyboard for the hotkeys.

This example shows the project navigation with blocks:



And here you can see the first version of the export and mp3 conversion - this version was not sending the song by email yet! This one was done more in a hurry so no sound or explanation.


Post Reply
  • Information