- - Windows 7/8 only. It uses the .Net 4.5 framework so no installation is required.
- The file paths are hard-coded so don't place the app folder anywhere else.
- Bitwig has to be running for the add-on to complete it's launch, if it can't find Bitwig it will terminate.
- No one but me has used this app so things like Norton will "flag" it because it's not in their database.
- The source file for the actions is 'commander.txt' in the app folder. You can manually edit it.
- The macro window is currently static, can't be moved. I'll make it drag-able later.
- I'll also add a search filter for the action list at some point.
Macro Editor (Windows)
-
- KVRAF
- 6159 posts since 4 Dec, 2004
Here is the beta download for the Windows add on. Just copy the "Bitwig Macros" folder in the zip and paste it in your "Documents" folder and manually make a taskbar shortcut to the program file.
You do not have the required permissions to view the files attached to this post.
- KVRAF
- 2960 posts since 9 Dec, 2011 from falling
Nice work! This is something that should be built into Bitwig. 
It seems like we could make this cross-platform somehow. I get this uses uses the .Net 4.5 framework. I wonder how we need to do this for Mac and Linux?
It seems like we could make this cross-platform somehow. I get this uses uses the .Net 4.5 framework. I wonder how we need to do this for Mac and Linux?
Bitwig Certified Trainer
-
- KVRist
- 82 posts since 25 Mar, 2014
Wow! that looks amazing! exacly what I needed, can't wait to try this thing
Bitwig - hire this man!
Bitwig - hire this man!
-
- KVRAF
- Topic Starter
- 6159 posts since 4 Dec, 2004
It would probably be easy enough to duplicate on Mac for anyone so inclined, especially with something like Xojo which compiles for Win & Mac. Like I mentioned earlier the only really time consuming part was the the menu and list themes, without using custom controls already setup for that.billcarroll wrote:It seems like we could make this cross-platform somehow.
The actual command sending is just Windows "SendKeys", really simple stuff tbh. The Win API gives the app window focus and just sends it whatever key commands you send it. Took like 15 minutes to make commands work, but some hours to design and code the UI bits.
Anywho, that commander.text file is still kinda wacky, needs more editing, has some duplicates and some items where I couldn't find the actual command to use.
Last edited by LawrenceF on Fri Nov 14, 2014 3:06 pm, edited 2 times in total.
- KVRian
- 1372 posts since 28 Dec, 2012 from Meredith NH
I know I have done cross platform apps with LibGDX, runs with Java.
Is the source code available for this Lawrence?
Are you using Windows specific things that Java couldn't access?
Mike
Is the source code available for this Lawrence?
Are you using Windows specific things that Java couldn't access?
Mike
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
- KVRAF
- 2960 posts since 9 Dec, 2011 from falling
I'll check out Xojo.
I've been digging into Keyboard Maestro for the Mac - http://www.keyboardmaestro.com. You can string together complex keyboard and menu driven Macros easily, but there is no real UI. I have my app launcher Alfred --http://www.alfredapp.com -- integrated with Keyboard Maestro, so I can just quickly fire off any Keyboard Maestro Macro. However, there is real appeal to making the Macro system look like it's part of the Bitwig UI.
edit - just saw the post from TeotiGraphix re: LibGDX. This shows some promise.
I've been digging into Keyboard Maestro for the Mac - http://www.keyboardmaestro.com. You can string together complex keyboard and menu driven Macros easily, but there is no real UI. I have my app launcher Alfred --http://www.alfredapp.com -- integrated with Keyboard Maestro, so I can just quickly fire off any Keyboard Maestro Macro. However, there is real appeal to making the Macro system look like it's part of the Bitwig UI.
edit - just saw the post from TeotiGraphix re: LibGDX. This shows some promise.
Bitwig Certified Trainer
-
- KVRAF
- Topic Starter
- 6159 posts since 4 Dec, 2004
I mostly code in VB for this kinda stuff, it's just faster for simple things like this. I might share the source code later once it gets deeper into beta. It's a pretty small project.TeotiGraphix wrote:Is the source code available for this Lawrence?
Are you using Windows specific things that Java couldn't access?
Mike
And yes, the Windows .Net framework is not at all directly compatible with anything else afaik, without some bridging. What you'd do is just use similar methods in the other frameworks, Mac or Linux to get to the same place.
- KVRian
- 1372 posts since 28 Dec, 2012 from Meredith NH
Ok, yeah I have used a little of the .NET framework, mainly a Java dev so..LawrenceF wrote:I mostly code in VB for this kinda stuff, it's just faster for simple things like this. I might share the source code later once it gets deeper into beta. It's a pretty small project.TeotiGraphix wrote:Is the source code available for this Lawrence?
Are you using Windows specific things that Java couldn't access?
Mike
And yes, the Windows .Net framework is not at all directly compatible with anything else afaik, without some bridging. What you'd do is just use similar methods in the other frameworks, Mac or Linux to get to the same place.
I don't quite get what you are doing under the hood, that is the only reason I asked about the source code to see if the techniques you were using could be translated into something java.
Mike
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
-
- KVRAF
- Topic Starter
- 6159 posts since 4 Dec, 2004
Here's the source that sends the commands when you double click a macro. It's only in two sub routines here because the second one "RunMacro" gets used by other controls. "SetForgroundWindow" is a Windows API call that gives a window focus when you need it to have focus.
That part could have been done with other API's, sending keystrokes directly to another app window without giving it focus (SendMessage API) but SendKeys works fine for this purpose.
That part could have been done with other API's, sending keystrokes directly to another app window without giving it focus (SendMessage API) but SendKeys works fine for this purpose.
Code: Select all
Private Sub SavedMacros_DoubleClick(sender As Object, e As EventArgs) Handles SavedMacros.DoubleClick
' Clear the Editor List
MacroList.Items.Clear()
' Load the macro
MacroList.Items.AddRange(IO.File.ReadAllLines(AppFolder & "\Macros\" & SavedMacros.Text & ".bwsmacro"))
' Update the macro name in case the editor is open
MacroName.Text = SavedMacros.Text
' Run the macro
RunMacro()
End Sub
Private Sub RunMacro()
' Arry for splitting the list item
Dim CmdKeys() As String
' Give BWS the window focus
SetForegroundWindow(BWS)
Dim I As Integer
' Iterate through the macro list steps, split and send each key command [ary(1)]
For I = 0 To MacroList.Items.Count - 1
' Split the item and assign it to the array var
CmdKeys = Split(MacroList.Items(I), "|")
' Send item 1, the command
SendKeys.SendWait(Trim(CmdKeys(1)))
Next
End Sub
- KVRian
- 1372 posts since 28 Dec, 2012 from Meredith NH
Ok, I see what you are doing. So if it was Java, there would have to be a way to send key strokes to another application. Which I have never done, so thanks (if even possible?). 
"Apparently the only way to do this is to have a JNI layer that will make the conversion from java to native. Java has no easy way to provide such functionality."
So its what I figured, there would have to be a C++ layer in between for each OS.
EDIT: It doesn't have to be C++, I meant a compiled library that java could load and then use JNI to call methods of the library specific to the OS.
Mike
"Apparently the only way to do this is to have a JNI layer that will make the conversion from java to native. Java has no easy way to provide such functionality."
So its what I figured, there would have to be a C++ layer in between for each OS.
EDIT: It doesn't have to be C++, I meant a compiled library that java could load and then use JNI to call methods of the library specific to the OS.
Mike
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
-
- KVRAF
- Topic Starter
- 6159 posts since 4 Dec, 2004
It should be possible on any platform really, they all have window handles or ID's. Now if they have a built in function like SendKeys in Java, no idea, if not you'd likely have to get there another way, via whatever API functions that serve basic messaging.TeotiGraphix wrote:Ok, I see what you are doing. So if it was Java, there would have to be a way to send key strokes to another application. Which I have never done, so thanks (if even possible?).
"Me no know Java." Javascript, sure. Java, never touched it. I wouldn't know a Java Bean from a real Coffee Bean.
Anyway, what's obviously missing from the add-on's command list is a "Sleep" command action, for times when you'd want to fire a step and have the macro sleep for 500ms or something before firing the next step because of something not immediately happening. I'll add that later.
- KVRAF
- 6539 posts since 9 Dec, 2008 from Berlin
Microsoft just open-sourced Net, so who knows what will happen 
Cool work Lawrence!
Many of these things can also be accessed with the controller API in 1.1. through "Actions", but of course that has no real UI.
But I can see a less-controller-centric API in the future.
That could also bridge the gap between keeping the direct and easy to use concept BWS has now and still allow power users to customize to their hearts content.
Cheers,
Tom
Cool work Lawrence!
Many of these things can also be accessed with the controller API in 1.1. through "Actions", but of course that has no real UI.
But I can see a less-controller-centric API in the future.
That could also bridge the gap between keeping the direct and easy to use concept BWS has now and still allow power users to customize to their hearts content.
Cheers,
Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube
UrbanFlow.art · Instagram · YouTube
- KVRian
- 1372 posts since 28 Dec, 2012 from Meredith NH
Hmm, this seems like a lead in... thanks for giving us all the info you know!! HAHAThomasHelzle wrote: But I can see a less-controller-centric API in the future.
That could also bridge the gap between keeping the direct and easy to use concept BWS has now and still allow power users to customize to their hearts content.
Mike
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
- KVRAF
- 6539 posts since 9 Dec, 2008 from Berlin
No, it's just my personal vision, not any deeper insight.
It's something I personally think would make sense.
Cheers,
Tom
It's something I personally think would make sense.
Cheers,
Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube
UrbanFlow.art · Instagram · YouTube
- KVRAF
- 2960 posts since 9 Dec, 2011 from falling
Well, there is Python, which is also cross-platform.
For instance, to minimize the current window on OS X you can do something like this:
No reason you can't run different application specific commands based on OS, although I've always avoided coding stuff for Windoze. 
For instance, to minimize the current window on OS X you can do something like this:
Code: Select all
import os
cmd = """
osascript -e 'tell application "System Events" to keystroke "m" using {command down}'
"""
# minimize active window
os.system(cmd)Bitwig Certified Trainer
