PDA

View Full Version : Griffin PowerMate tool



camille
07-14-2011, 01:28 AM
Hi,

Here is a little tool to use the Griffin PowerMate with any OSC enabled application.
The attached zip contain an executable tool that can be double clicked (it will open a Terminal window), and an example Osculator file.

When the tool is launched, it searches for a PowerMate. I have not installed the drivers, so I can't tell for sure if there is no side effect with the software provided by Griffin, but I guess it should be ok. If there are some strange interactions, I would recommend to either uninstall the Griffin software or disable it there is a way to do so.

Right now, only one PowerMate can be used at a time.

The tool sends OSC messages to port 8000, which is the default input port of OSCulator.
The sent messages are as follows :


/powermate/button
A message with one float argument (0 or 1), that gives the state of the button. 0 is released, 1 is pressed.
/powermate/button/long
A message with no argument telling if the press on the button was a long press (600 ms).
/powermate/button/double
A message with no argument telling if the button has been double clicked in a short time (200 ms).
/powermate/rotation
The current rotation. It can go indefinitely in the positive of the negative direction. The message has one float argument that starts at value 0. 1 represents one full rotation in the clockwise direction, 2 two full rotations, and so on. -1 is one full rotation in anti-clockwise direction.
/powermate/rotation/bounded
The current rotation but stops at the [-1 1] bounds. The initial value is 0.
Note: I was wondering if I should not rather make it start at 0.5 and limit the bounds at [0 1]
/powermate/rotation/cyclic
The current rotation, but wraps around [0 1], that is, when a full turn is done, the value wraps at 0 again.
/powermate/rotation/increment
No argument. Sent every time the value increases.
/powermate/rotation/decrement
No argument. Sent every time the value decreases.
The tool listens for OSC message on port 7999.
It reacts to the following OSC messages:

/powermate/rotation/reset
Resets the /powermate/rotation message to its initial value (0).
No argument.
/powermate/led
Changes the led brightness.
One float argument between 0 and 1. A value of 0 means that the led is turned off, and a value of 1 means full brightness.

registered99
08-13-2012, 08:59 AM
Hi there,
Very nice tool so far. I'm wondering, is it possible to get this so that the increment/decrement can be run the entire time? Or can we have another event such as "wheel is incrementing" and "wheel is decrementing"? Problem I'm having is that Applescripts and such will only be run on the initial increment/decrement. If you don't stop, or move very quickly, the script is run just once, and you're left spinning the dial without any effect.

Thanks

camille
08-13-2012, 12:41 PM
Hi!

Note that in OSCulator, AppleScripts are triggered once and are supposed to be short lived events. I don't think that even a change to the powermate tool would help you solve this problem. Also AppleScripts are rather slow and long to execute, whereas the PowerMate events are fast in comparison, which means that the OS could certainly decide not to execute an AppleScript at a given moment.

Maybe a solution would be to add an argument that indicates the rotation direction to the /powermate/rotation message, so that you can trigger the AppleScript but only when the direction changes. Do you think it would work for you?


Best,
Cam

registered99
08-13-2012, 05:08 PM
Cam,

Thanks much for the reply. I think that this would be useful, though not necessarily for my case.

Perhaps I need to study a bit more about how Osculator works. I was just making a quick volume-knob which didn't use Griffin's driver. However, it seems like there are much faster ways to do so, without Applescript.

Thanks.

samvantoever
06-12-2014, 09:09 PM
Camille,

Is it also possible to connect multiple powermates?

Best, Sam

Naenyn
06-29-2014, 10:46 PM
I'm very curious about this. I recently purchased a PowerMate Bluetooth and am looking for a way to get MIDI CC out of it. Should this work with the bluetooth version?

camille
06-29-2014, 11:39 PM
Hi Naenyn,

I don't know if this the PowerMate tool has been tested successfully with a Bluetooth PowerMate.
This tool is free, would you like to try?

Camille

Naenyn
06-30-2014, 06:25 AM
I'd be happy to try it once I receive it this week. =)

I'm assuming it'd work the same way as the USB version...

Does the USB version stop sending messages when the max value is achieved? Or does it loop back around to zero?

camille
06-30-2014, 08:38 AM
Does the USB version stop sending messages when the max value is achieved? Or does it loop back around to zero?

There is a different message for both cases, look at the dictionary in the first post.

yommulator
12-07-2014, 02:19 AM
I am trying it out on mac os 10.9 with latest osculator (2.13.2) version and it is not working. The scripts is executing ok but I am getting no response in osculator. Any hints perhaps ? I tried running the executable as root but that didn't make a difference.

camille
12-07-2014, 10:43 PM
Hi Yommulator,

I don't seem to have any problem on 10.9.5.
Here is the output I get on my computer:



nightfly:oscltr-powermate camille$ ./oscltr-powermate
- 22:41:04.018658 INFO: PowerMate Tool - version 1.0
- 22:41:04.018803 INFO: This software is part of Osculator (c) Wildora, 2011.
- 22:41:04.018810 INFO: Ready to output on port 8000, listen on port: 7999.
- 22:41:12.581030 INFO: Device found:
- 22:41:12.581060 INFO: Vendor: Griffin Technology, Inc.
- 22:41:12.581105 INFO: Product: Griffin PowerMate
- 22:41:12.581147 INFO: SN#:
^C- 22:41:25.100403 INFO: Exit.


And OSCulator was receiving data, I tried the example oscd file.

Cam

yommulator
12-12-2014, 08:57 PM
Hmm strange. I did a fresh install of Mavericks (10.9.5) and Osculator (because i had recently installed the powermate official drivers and macports and other things so i thought it might have messed a bit with my powermate and/or terminal/bash). But still no luck with the osc powermate script on the 'virgin' install. I'm running an Imac late 2013 2,9Ghz I5. The script doesn't seem to detect the powermate. Mac OS recognizes it because the mouse pointer is moving when i turn the powermate and the button is passed as a mouse click. (no powermate drivers installed)

Here's my terminal output:

pc165:oscltr-powermate yomm$ ./oscltr-powermate
- 20:18:35.081152 INFO: PowerMate Tool - version 1.0
- 20:18:35.081463 INFO: This software is part of Osculator (c) Wildora, 2011.
- 20:18:35.081471 INFO: Ready to output on port 8000, listen on port: 7999.

So no Device found as in your output ...

This showed up in dmesg: (not sure if it is related)

SMC::smcReadKeyAction ERROR TL0V kSMCKeyNotReadable(0x85) fKeyHashTable=0x0xffffff80e18c3000


No joy yet :)

Keep up the good work !

camille
12-14-2014, 12:45 PM
Hi,

The Powermate never controls the mouse pointer. So I there is something wrong either with your operating system (have you installed a specific driver?) or the device you are connecting is not a Powermate.

Best,
Cam

yommulator
12-18-2014, 08:28 PM
Hi,

The Powermate never controls the mouse pointer. So I there is something wrong either with your operating system (have you installed a specific driver?) or the device you are connecting is not a Powermate.

Best,
Cam

Hi Camille,

I tried the powermate with and without the drivers installed (even on a clean mavericks install, so i can rule out the drivers being the issue).
I think i definitely have a powermate. It might be a first generation powermate. Here is how it looks:
515
The powermate always moves the mouse pointer (just by a tiny bit) when plugged in, even without any driver installed (tested on both my Intel Imac & PPC G5) , Maybe I have an older model Powermate ?
It works fine though on intel & PPC mac with the latest griffin drivers installed.

As I said I can rule out drivers & OS being the issue because i did a clean install of Mavericks with no griffin drivers and that didnt work.

Cheers,

Yommulator

MC242
01-26-2018, 04:21 PM
Hallo Camille! Hallo, everyone! I'm new here! I have just purchased a new Osculator 3 license.
I got your script working fine on MacOS 10.11.6 However I have a question that will be quite simple to answer for you as the developer.
I try to convert the Powermate rotation to Midi CC to control an automation in Logic Pro X which works.
But when I turn the Powermate clockwise, the Midi Message goes up (or down when I turn counterclockwise) until 127 is reached and then begins at 0 again.
How can I make this stop at a value of 127?
And another question would be if I can also reach a finer solution with OSC or Midi NRPN. What would I have to put in the Event Type and value fields in Osculator to reach this and would Logic Pro X recognize this?

Best wishes and thanks for this great script!

camille
01-31-2018, 10:48 AM
Hi MC242,

Use the /powermate/rotation/bounded message, it emits values that do not wrap around.

OSCulator 3 has support for creating any kind of MIDI message you like with "MIDI Templates". It's a little but more involved than just selecting a MIDI because you have to describe the NRPN with hexadecimal values.

If you wish to know more, please open a new thread and please give information about the NRPN you would like to send a receive, I will write a small tutorial on how to make this happen.


Best,
Cam

MC242
01-31-2018, 05:31 PM
Thank you very much for the answer, Camille! I have just updated from El Capitan to Sierra for the latest Logic Pro X version and I'm experimenting now.
I think I will also try to connect the Powermate with the app DFader which allows to hover the mouse over a parameter and control it with an external midi controller.
But the NRPN resolution would be a great thing.
Also there is the OSC protocol which might be even more interesting and far more flexible.
So maybe I'll open a new thread then naming it Using Griffin Powermate and the Powermate tool to control Logic Pro X.

Best wishes and thanks again,

Michelle.