Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 3      1   2   3   Next
davr

Avatar / Picture

Registered:
Posts: 49
Reply with quote  #1 
This looked like the perfect controller for engineering, and it was fairly cheap, so I bought one. I'm now working on a python script which will take input from the device and update engineering sliders / coolent levels to match. I also want the LEDs on the controller to blink in response to the heat levels of the various engineering devices.

$45 on Amazon



It's basically just a MIDI device that plugs in via USB. Each control outputs a different MIDI message, and it's really easy to read in python. Here's a link to my code in progress, so far it just does all the basic input & output, doesn't do anything to artemis yet:

https://github.com/davr/ArtemisMidiKontrol

And here's a short video of me testing the sliders / LEDs, and using the knobs to control the mouse position.



So I know everything I want to do is possible (read slider values, change LED states, move mouse position), I just need to tie it all together. Currently windows only because I'm calling the win32 API directly to move the mouse position since that was simplest, and because it's a windows-only game anyway.

In theory this should be easy to port to any other MIDI device with a bunch of sliders and buttons, assuming they all send similar midi events.
GrendelPrime

Avatar / Picture

Registered:
Posts: 27
Reply with quote  #2 
Very interested in this, thank you for sharing your work so far!
I'd be willing to forego engineering presets to have this kind of interface for a build.  

__________________
There is an old Celtic saying: "Coimhéad fearg fhear na foighde."
-Beware of the anger of a patient man.
Wintercross

Avatar / Picture

Registered:
Posts: 12
Reply with quote  #3 
This is something I'm keen to do. Engineering with a midi slider panel would be amazing
davr

Avatar / Picture

Registered:
Posts: 49
Reply with quote  #4 
Got it working about 90% -- Moving the sliders adjusts in game sliders, and turning the knobs adjusts coolant. Not sure if I prefer using knob for coolant or if being able to press the up/down buttons would be better. Things that need improvement:
1. It's currently hardcoded for my laptop display of 1280x800, I need to figure out how to make it work with any display resolution
2. Tweaking the timing a bit or something, sometime if you move the sliders quickly the on game sliders don't quite match what you set yours to
3. Better instructions on what you need to install to make it work
4. Design an overlay that you can print out and stick on top of the controller, that has labels for the stations etc on it.

But if any hackers want to see the code so far, it's all in the github link above.
MarkBell

Avatar / Picture

Administrator
Registered:
Posts: 1,925
Reply with quote  #5 
Can't wait to see this in action, very interested
__________________
Note - this is in no way intended to be an official position of Thom or Artemis, as I am not an official representative of the creator or game.
duncane

Registered:
Posts: 13
Reply with quote  #6 
Do you think that NanoPad (from Korg too) can be used as input device as well?

It seems to be a rather good companion to the NanoKontrol as it includes a trackpad.
davr

Avatar / Picture

Registered:
Posts: 49
Reply with quote  #7 
Quote:
Originally Posted by duncane
Do you think that NanoPad (from Korg too) can be used as input device as well?

It seems to be a rather good companion to the NanoKontrol as it includes a trackpad.


Yes, I think any midi device should be usable as an input device, as long as the proper code (in python or whatever) is written to accept the midi commands and output the correct mouse / keyboard commands.
duncane

Registered:
Posts: 13
Reply with quote  #8 
I was more thinking of mapping the device as a joystick, that way, we should be able to map throttle directly from the device to the game.
CaptainFelix

Registered:
Posts: 12
Reply with quote  #9 
Hey Everybody,

I would like to present my Hardware Controller for the Engineering Console of Artemis!
In the old forum I proposed to introduce more Keyboard Controls for Engineering to use with MIDI-to-Keypress Software, but thanks to davr I learned that Python can use MIDI data - great!
So this is my old Peavy Studiomix which is connected via a simple USB-to-MIDI-Dongle to my Laptop, where the Python Script, which is of course based on the Script from davr, interpretes the MIDI packets and the triggers the mouse.
Using the Controller you can set the Energy Level aswell as the Coolant for every System, reset the Energy Level for both a single System aswell as for all Systems on one time, reset all Coolant Values at one time and set and use up to eight Presets.
How do you like it? Any comments are appreciated!



Edit: The code can be found posted below or at GitHub (https://github.com/ArtemisHardware/ArtemisMidiKontrol)
woodat

Registered:
Posts: 25
Reply with quote  #10 
*drooling*
duncane

Registered:
Posts: 13
Reply with quote  #11 
I must admit i'm interrested in the code.

Regards,
David
Sintax7

Registered:
Posts: 87
Reply with quote  #12 
Very cool!!  Nice implementation.  :-)
__________________
Lee A Keiser II - sintax7@gmail.com 
https://www.facebook.com/groups/simpitbuilder/
https://www.facebook.com/TheStarshipSimulator/
GrendelPrime

Avatar / Picture

Registered:
Posts: 27
Reply with quote  #13 
Quite possibly the slickest implementation of a hardware Engineering console yet! [thumb]
Shame I don't have one lying around (or ~$500 to pick one up).

__________________
There is an old Celtic saying: "Coimhéad fearg fhear na foighde."
-Beware of the anger of a patient man.
CaptainFelix

Registered:
Posts: 12
Reply with quote  #14 
Hi everybody,

it got a couple request for the code, sorry that it took so long!
Please note that my code is hardwired to my two screen setup and it's resolutions. I took screenshots of Artemis and then found the right coordinates through MS Paint :-)
And it's pretty hardwired to my Peavy Studiomix Controller, too. A other cool (and quite cheap) controller that would look great together with Artemis is the Behringer BCF2000. But of course the MIDI packets would differ, I cannot help with that.
For presets I cheated a little bit. Since I dont know how to read the current values of the onscreen sliders to move the hardware sliders into position, I decided to store the current positions of the hardware sliders in a little file. So currently coolants and energy levels are stored using the ingame preset function and then the sliders are moved into the position stored in the presets.cfg ;-)
Since I'm no developer my code is pretty ugly but somehow works and I tried to comment as much as possible. There is a warning when you execute the code regarding the global sliderValue, but it still works...
I used Python 2.7 together with PyGame 2.7.
Many thanks again to davr!!!

Feel free to contact my if you have any questions!

Kind regards,

Felix

 
Attached Files
txt AMK.py.txt (12.06 KB, 95 views)
txt LICENSE.txt (1.06 KB, 36 views)

duncane

Registered:
Posts: 13
Reply with quote  #15 
I'll take a close look at your code once i've got some time ahead of me, and I'll try to figure out ways to optimize it, or rather to have the whole stuff runing on a more universal way.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.