On a separate Issue,
How do you get the MIDI messages that are sent back to the APC Mini to illuminate the LED’s in the buttons? Seems they are not returning back through a defined alias (e.g. BMT 1 ) In Daslight it’s easy to define the LED, return port, color, brightness etc… Previously, I just mapped the return LED signal to the APC but now I need to return it via a virtual port- see reason below…
I just created a project that allows me to create 4 different pages of the APC Mini MK2 buttons by switching 4 virtual ports. This allows me 4x 64 scene buttons to map. Works great, however, getting the defined led signals back is not yet happening. I was also wondering when I engage a new page is their a way to refresh all the button LED’s at that time?
Thank you! Your videos really helped me getting this project moving along.
The output of Daslight would be BMT 1 and then within Bome MIDI Translator Pro you would route that signal to the APC-MINI.
Note that the LED brightness of the APC -MINI MK2 depends on the MIDI channel you return for the 8x8 matrix LEDS. The velocity devices the color. This post shows how it works.
MIDI CH 7 is the brightest. After that it changes to the blink rate.
For the side and bottom buttons, you use MIDI CH 1 and the velocity of 127 for on and 0 for off but there is only one color.
As far as updating LED’s when the preset changes, you would need to capture the return value of all LEDs all of the time in global variables but not send them to the controller and then use a timer to update all LEDs as a given layer is activated. This would be triggered by an enable preset message.
I typically use a bit map ( 2 state) of the buttons’ state and then define an ‘on-color’ and ‘off-color’ to send depending on the state. This post show how it is done with an APC-MINI MK1. There may be an example for the MK2 on the forum as well.
There are rules that can be used for bit operations shown here. With two global variables you can handle 64 button on/off states since each global variable is 32 bits.
Steve Caldwell
Bome Customer Care
Also available for paid consulting services: bome@sniz.biz
Thanks! I just got it working for a couple of buttons/pads with an ON, OFF translator for each button, not very efficient, and would take for ever for 4x 64 pads! Looks like I have to overcome the glazing over of my eyes as I approach trying to understand bit operations… you may get an email from me.
Hi Steve,
Seems I may have found a work around for updating the Button LED’s when I initiate a page change for the APC Mini MK2. I managed to create an Apple script that changes MIDI configurations in the Apple Midi Studio window. Even though the configurations are the same with just a name change it causes an instant re-fresh of the controller and all my buttons on the controller update and illuminate correctly. I have to admit I’m a total noob with Applescript so I basically started in Automator and then converted it there into AppleScript then copied the txt into AppleScript editor did some changes and it runs much faster via AppleScript. Problem is, when I paste the scrip into a AppleScript output window in a Translator I get an:
OUT 1.2 ERROR executing AppleScript: action_1_2(): error -2741: Expected “end” but found “on”
Weird because there are no errors when run outside of Bome.
Any Ideas?
Here’s the script (BMT 1 is the name of the configuration in Midi Studio):
– Make a selection from the popupbutton.
delay 0.276307
set timeoutSeconds to 0.0
set uiScript to ‘click pop up button 1 of tool bar 1 of window "MIDI Studio" of application process "Audio MIDI Setup"’
my doWithTimeout(uiScript, timeoutSeconds)
– BMT 1
delay 0.122993
set timeoutSeconds to 0.0
set uiScript to ‘click menu item "BMT 1" of menu 1 of pop up button 1 of pop up button 1 of tool bar 1 of window "MIDI Studio" of application process "Audio MIDI Setup"’
my doWithTimeout(uiScript, timeoutSeconds)
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script ‘tell application "System Events"
" & uiScript & "
end tell’
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Can not " & uiScript
end if
end try
end repeat
end doWithTimeout
Well I’m not an expert with AppleScript. My guess is that outside of Bome MIDI Translator Pro the errors are suppressed in more cases. Maybe it should be exit repeat instead of end repeat. Or maybe you nee another carriage return at the end of the script. I really don’t know. Interesting that the LED’s remember where they were. Never tried this kind of approach.
Steve Caldwell
Bome Customer Care
Also available for paid consulting services: bome@sniz.biz
Yes, I think Automator introduced some scrip that AppleScript can accept, but only runs in the script editor, also it does run as a stand alone App.
When watching a midi monitor when the connection of the port is re-opened it causes DasLight to send back all the note info for illuminating the buttons. This I could figure out what command triggers that and bypass AppleScript. Here is the first part that is captured when Midi Studio Config is changed: (just in case you see what’s doing it)