The Music Studio

He tried learning scripting for the first time and you won't believe what happened

Reply
  Tools
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
He tried learning scripting for the first time and you won't believe what happened
With a heading like that hopefully this forum might light up again!

Anyhow, I want to create a script using Autohotkey to automate the tedious process of opening Reason, telling it which authorisation mode to use, opening a song and telling it where to find the missing files.

I've got as far as opening the program, that's on the train so far this afternoon. Has anyone else done something like this before? Or is there a macro recorder which would be better to use?

Thanks.

Sorry for the clickbait.
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Figured it out. No problemo!
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Celebrations might have been a bit premature. Not sure how to open one file at a time with autohotkey. I can open the same file again and again. Thinking it has something to do with loop perhaps, but haven't found out what yet. Any help is appreciated. Even a simple hello really.
Spectrum +

What?! No Crossfader!

Spectrum's Avatar
Joined
May '01
Times thanked
<
Thanks: 2
Thanked 147 Times in 96 Posts
Posts
9,193
Absolutely no frickn idea, just wanted to give top marks to the intriguing thread title, it made me wanna sign up...
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Hey Spectrum! Thanks for posting anyhow.
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Happy to pay.
rhythmboy +

"I am the Beef Chief..."

rhythmboy's Avatar
Joined
May '02
Times thanked
<
Thanks: 0
Thanked 2 Times in 2 Posts
Posts
843
No F***n idea either, but at least the thread title prompted me to log in for the first time in about 20 years and make a post
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Hey rhythmboy, I remember you. Gave me a great tip once on playing percussion via MIDI:

Load up a sampler of 88 keys of bongos, congas and the rest of it. Hit record. Mash the keyboard repeatedly. Quantize. Profit.

At least I think that was you? Ring any bells?
rhythmboy +

"I am the Beef Chief..."

rhythmboy's Avatar
Joined
May '02
Times thanked
<
Thanks: 0
Thanked 2 Times in 2 Posts
Posts
843
^ Smash & Quantize

I should make a plug-in!
chickenbum +

Registered User

chickenbum's Avatar
Joined
Feb '09
Times thanked
<
Thanks: 0
Thanked 30 Times in 26 Posts
Posts
1,392
Im just gonna chime in and say HIIIIIIIIII
rhythmboy +

"I am the Beef Chief..."

rhythmboy's Avatar
Joined
May '02
Times thanked
<
Thanks: 0
Thanked 2 Times in 2 Posts
Posts
843
Thread hijacked by mildly entertaining inane chatter

Much better than 'what headphones do I buy?' and 'sample packs for sale'

All we need is some trolling and it will be just like old times
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
New thread ideas:

1. Can someone recommend some good studio monitors/headphones/DAW?
2. How can I make this psy/trance/Deadmau5 sound?
3. Needs more DAWg
rhythmboy +

"I am the Beef Chief..."

rhythmboy's Avatar
Joined
May '02
Times thanked
<
Thanks: 0
Thanked 2 Times in 2 Posts
Posts
843

Quote:

Originally Posted by Fewsion View Post

New thread ideas:

1. Can someone recommend some good studio monitors/headphones/DAW?
2. How can I make this psy/trance/Deadmau5 sound?
3. Needs more DAWg

4. Should I spend $1million studying at SAE?
5. Why has my Ableton crack stopped working?
6. Timothy Allan pimps his studio
Joe-Trojan +

distorted distortion

Joe-Trojan's Avatar
Joined
Jun '09
Times thanked
<
Thanks: 50
Thanked 69 Times in 54 Posts
Posts
1,528
haha I was expecting something like, "now I'm just so very productive at making tracks"

....but no, you're still bogged down in the technical stuff haha.

Keep at it. I just use shortcut keys but I prob should script up some command secquences.
soundcloud
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Have you used autohotkey? Pretty easy to do repetitive tasks once a window is open. Sh*thouse hard when you need to open files one by one and get going on them.

It does sap the creative juices, this is true. Should stop posting here and stop learning scripts!
jester_fu +

I ammmmmmmm

jester_fu's Avatar
Joined
Jul '03
Times thanked
<
Thanks: 88
Thanked 225 Times in 94 Posts
Posts
4,011
Are you trying to open the same file all the time? I don't think the autohotkey program is really designed to open files for you - particularly not different ones. With some executables, you can pass in 'switches' as you load the program. I'm not sure where you'd find that info for reason, but it might be as simple as creating a shortcut, then editing the "target" field to say \file path\Reason.exe /o "FewsionsNewTrack.fileext" where "/o" might be the switch for "open file". That way when you hit the shortcut, the program opens and auto loads that file.

I can't think how you'd ever locate "missing files" automatically - if they were in the path the program was expecting, then they wouldn't be missing. So not sure how you' tell it the right place in a script unless you already know the right place... which begs the question... why are the files missing from the path? I've never seen a program that you can switch to find something missing automatically. If Reason always looks in the same place for the files, you could write a batch file that copies the files you want from one location to another. You'd use the normal windows command line commands like "copy". You could get authotkey, from what i've read, to run the batch files for you as part of the hot key, but it doesn't look like Autohotkey will actually execute the batch for you from within it's interface - it needs to be told to run the batch file.

I think that would be part of your solution - have autohotkey open the batch files for you (or one batch file) as you can copy from the batch, but sleep/wait commands in there so things happen then there's a pause before trying to use them, run programs and add program switches etc.

Sorry to hijack the thread...
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Hijack indeed!

Trying to open all the files in a directory and I've come up with the following:

^+R::
Run, "Reason.exe"

With this the program opens. What I've gathered is that you can then access all of the "open" and "close" commands from the program itself with keyboard shortcuts, so it becomes a script that has huge amounts of "send" functions to press the keyboard. Scrolling through the buttons on the Reason GUI by pressing tab with something like this:

send {tab 9}

To send a "tab" keystroke 9 times or so.

A missing file browser comes up and I can point it to the direction of my samples (a huge folder, but if I leave the computer on overnight it'll get through it) and it'll automatically match the samples, if found, and place them in the appropriate instruments.

Then I could set the loop brace to the track with:

send {alt}{l}

and then export the loop as audio file with:

send {alt}{f}{down 9}{enter}

Anyhoo, I haven't gotten that far because I'm stuck at opening more than one file in a directory. I don't want to open them all at once because there are too many.

I've found a way of exporting the folder path of all the tracks to an Excel spreadsheet so that it was maybe easier running them from there, but again, not much of an Excel user, nor a code-maker. The main reason I'm attracted to this project is because it seemed like the automatic file loading with a script was sensationally faster than the painfully slow file browser Reason normally has. But the irony is that I've spent so long doing this now that I could have probably done the project the old fashioned way anyhow.

Does any of this make sense? Felt like a stream of consciousness somewhat.
rhythmboy +

"I am the Beef Chief..."

rhythmboy's Avatar
Joined
May '02
Times thanked
<
Thanks: 0
Thanked 2 Times in 2 Posts
Posts
843
jester_fu +

I ammmmmmmm

jester_fu's Avatar
Joined
Jul '03
Times thanked
<
Thanks: 88
Thanked 225 Times in 94 Posts
Posts
4,011
Personally, i think a batch file would be best with some file switches if they're supported by Reason.

So, it sounds like Reason isn't using the standard MFC's Microsoft put out there to basically use their inbuilt file browser. Can't understand why it'd be slower if they did - it sounds like they're going all "iTunes" and trying to lock stuff up.

It might also be worth opening one of the Reason project files (whatever the main extension is that causes reason to open) in text edit and seeing if it's just some XML or something... then you could recode the project main file to point to all the right places.
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
"Please step aside sir"

Quote:

Originally Posted by jester_fu View Post

Personally, i think a batch file would be best with some file switches if they're supported by Reason.

So, it sounds like Reason isn't using the standard MFC's Microsoft put out there to basically use their inbuilt file browser. Can't understand why it'd be slower if they did - it sounds like they're going all "iTunes" and trying to lock stuff up.

It might also be worth opening one of the Reason project files (whatever the main extension is that causes reason to open) in text edit and seeing if it's just some XML or something... then you could recode the project main file to point to all the right places.

I have absolutely no idea how to correctly use a switch, batch file, what an MFC is, or anything really that you've suggested. Where do you learn this stuff?
Joe-Trojan +

distorted distortion

Joe-Trojan's Avatar
Joined
Jun '09
Times thanked
<
Thanks: 50
Thanked 69 Times in 54 Posts
Posts
1,528

Quote:

Originally Posted by Fewsion View Post

Have you used autohotkey? Pretty easy to do repetitive tasks once a window is open. Sh*thouse hard when you need to open files one by one and get going on them.

It does sap the creative juices, this is true. Should stop posting here and stop learning scripts!

Nope I have never used autohotkey and didn't know it existed. I've only ever set up my own shortcut keys in Cubase, that's it.
soundcloud
jester_fu +

I ammmmmmmm

jester_fu's Avatar
Joined
Jul '03
Times thanked
<
Thanks: 88
Thanked 225 Times in 94 Posts
Posts
4,011

Quote:

Originally Posted by Fewsion View Post

I have absolutely no idea how to correctly use a switch, batch file, what an MFC is, or anything really that you've suggested. Where do you learn this stuff?

Batch files and application "switches" will be google. The app switch is just some commands you put after the "application.exe" text in a shortcut or at the command prompt. There's lots of stuff online about batch files but you can also start the command prompt in Windows and type "help" and the command list comes up. You then pick a command and type "command /?" and it'll list the specifics for that command. A batch file you create in notepad and instead of having .txt on the end (file extension) you use ".bat". Then when you click it, it opens the command (CMD from run) and executes the commands in the order they appear in the file.

MFC is a Microsoft Foundation Class. It's what Microsoft provide in their development environment so people can access inbuilt windows features. You don't have to use it, but it's used by most people who program and provides a consistent look with the explore/save type popups within programs. Learning about MFC's requires going over .Net development manuals etc. I don;t think you need to know about it - i was just suggesting if the look/feel of the reason file browser is different to all the other browsers (like word etc.) then they've probably done their own thing.
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Thanks jester. Worth a shot with the batch files and switches for sure. I opened Reason in a text editor and it spat out some pretty gibberish info, I couldn't confirm what it was.
jester_fu +

I ammmmmmmm

jester_fu's Avatar
Joined
Jul '03
Times thanked
<
Thanks: 88
Thanked 225 Times in 94 Posts
Posts
4,011
Just thinking as well - see if there's a *.ini file for reason somewhere. This might be text editable and you could use batch files to replace it and change your config. You may need to dig on the Reason forums or ask them... but it's likely any preference you set when the program is running get written to a simple file structure the program reads on startup so it can load them again. If it's easy to edit in xml or text or something, it might help you write your own and the copy them to the default file reason looks for when starting up.
Fewsion +

Registered troll

Fewsion's Avatar
Joined
Oct '03
Times thanked
<
Thanks: 634
Thanked 104 Times in 89 Posts
Posts
3,663
Props forums have been balls in my experience, much more help comes from here, from non-Reason users even, I'll give it a crack though. No .ini file found in the installation directory, in hidden files or operating system files either.
Reply

« Previous Thread Next Thread »

Posting Rules

+
    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts