Old 03-02-2016, 06:16 AM   #1
jamesd256
Human being with feelings
 
jamesd256's Avatar
 
Join Date: Dec 2015
Location: Folkestone
Posts: 160
Default Spacemouse! 6DOF scrolling panning and zooming!

This is not really a howto as it's ongoing. But if you follow this you can use a 3d mouse like me in Reaper.

I finally received my eBay purchase from the US; a 3dconnexion Spacemouse XT Plus USB. It's a 6DOF controller of the type commonly used by CAD professionals.

After much research into which cheap legacy models might be a good choice, I'm pleased I think I got the right one. The 6DOF sensor in this one is the same as the current generation of 3dconnexion devices. Cost was £15

These things were expensive back in the day, and it shows in the design and build quality - absolutely superb. The operation as it turns out is super sensitive smooth and precise.

As expected, the drivers situation is that it will be hard or impossible to get it working in Windows 10 the 3dconnexion way.

Nevermind, I had pinned my hopes on Sx2vJoy, a very obscure but amazing piece of work which could maybe bring these legacy devices back to life by sending the output to vJoy. And guess what...

I embarked on this because I wanted a ShuttlePro - then I found out about the world of 3d mice. Same shape thing, with a knob and some buttons, but 6 analogue axes

Knowing vaguely that Reaper supports joysticks, I took the plunge and bought one.

I am happy to report that the whole setup works amazingly well.

Setting up Sx2vJoy to vJoy and seeing the Windows 10 joystick control panel showing the 6 axis and 11 buttons working was the first proof it was going to work.

But having told Reaper to use the joystick, there were a couple of issues. Firstly, the joystick diagnostic wouldn't respond to input. Restarting Reaper solves that, and subsquent restarts bring the joystick back online.

Next, mapping the CCs from the joystick input to Reaper actions resulted in random skittish jumps and no control at all.

Using ReaControlMIDI's excellent midi monitor, it was clear that each input was sending 2 CCs, one for LSB, one for MSB. If I could only map to the MSB only CC, it should be fine I thought. The trouble is, the action learning dialog always picked up the second controller message (even with that auto checkbox set).

This brought me to the question of how I would edit the action mappings via a text file, something I didn't figure out.

The solution was to edit the generic.txt joystick configuration, where it iterates the axes found, for the first one it finds it assigns to pitch bend, but subsequent ones are assigned like this:

event($xb0, i, (v/128)|0);
event($xb0, i+32, v&127);

Commenting the second line means that only one CC is mapped per axis, with the MSB used to give the range of 0-127 - this is what you need for flying Reaper. You must use relative 2 as the action option.

The result? Super smooth control with precise acceleration. So far I have tested out mapping Z rotation to pan and Y displacement to track volume, and found you get precise one handed control of the two simultaneously. It's like having a fader and pot in your hand at the same time if that makes sense.

Sx2vJoy is absolutely brilliant at managing deadzones, inversions, acceleration, mapping and response curves!

Tonight I'm going to try out panning, zooming and scrolling.

If anyone is still reading, I have some questions about coding the joystick mapping. What language is it? Is there a reference somewhere? Can the config hold state, like a toggle state for the buttons which could switch the CC numbers?

Possibilities seem fairly endless. Especially If I can use the buttons to switch the axes CCs dynamically (ReaScript if not the joystick config?)

This is the link you need for driving the Spacemouse:

https://forums.frontier.co.uk/showthread.php?t=35024
jamesd256 is offline   Reply With Quote
Old 03-02-2016, 09:24 AM   #2
jamesd256
Human being with feelings
 
jamesd256's Avatar
 
Join Date: Dec 2015
Location: Folkestone
Posts: 160
Default

I thought I would just take a look at the source code of Sx2vJoy, and to my amazement, it's written in Autohotkey.

I had no idea it was capable of so much. The GUI is polished and the whole thing is deployed as an .exe. You'd never know.

This does mean that if the joystick mapping functionality of REAPER doesn't do what I want, there is the option of adding midi output directly from the Sx2vJoy ahk code.
jamesd256 is offline   Reply With Quote
Old 05-03-2021, 10:19 PM   #3
AleRatsel
Human being with feelings
 
Join Date: May 2020
Posts: 1
Default

Hello,any luck with Spacemouse?

I have a Spacemouse Pro that i'm trying to use with reaper..
AleRatsel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.