WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Space Navigator Script

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Bugsbunny



Joined: 23 Feb 2007
Posts: 4

Digg It
PostPosted: Tue Feb 27, 2007 12:37 am    Post subject: Space Navigator Script

Sorry for cross-posting but I realized my first post was in the wrong forum. My situation is as follow; I got a space navigator device from 3d connexion. Having installed PPjoy and 3dxppjoy, I m sending midi messages to music programs through Midi yoke.
Here is an example of the script (please don't laugh...)

midi.BankSelectLevel = MapRange(Joystick2.x, -1,1, 0,127)/127
midi.ModWheel = MapRange(Joystick2.y, -1,1, 0,127)/127
midi.Breath = MapRange(Joystick2.z, -1,1, 0,127)/127
midi.Control3 = MapRange(Joystick2.pitch, -1,1, 0,127)/127
midi.FootPedal = MapRange(Joystick2.yaw, -1,1, 0,127)/127
midi.PortamentoTime = MapRange(Joystick2.roll, -1,1, 0,127)/127

Well, the data is sent and read with no problem from external music app, except for a very annoying detail: normally midi data consist of integrated numbers between 0 - 127. Well, in my case the data received by all tested applications shows that it is going beyond these limits. The result being that when for example a knob gets to its maximum, it "virtually" continues to increase above 127. It is very annoying as afterwards, the knob's value won t decrease before it gets back to 127.
Is there anyway of preventing this by, let's say, limiting the output data threshold?

Thanks in advance for any suggestions
Back to top
View user's profile Send private message
TylerK



Joined: 18 Dec 2006
Posts: 384
Location: Springfield, IL

Digg It
PostPosted: Tue Feb 27, 2007 1:58 am    Post subject:

Try changing each instance of MapRange to EnsureMapRange. That should confine it to the minimum and maximum values.
Back to top
View user's profile Send private message
Bugsbunny



Joined: 23 Feb 2007
Posts: 4

Digg It
PostPosted: Wed Feb 28, 2007 12:14 am    Post subject:

Thanks for your answer TylerK.
I actually tried that yesterday after having read a post from Carl Kenner. I also tried EnsureRange, but neither solved the problem. If that can be of any help, when it overpasses 127, the music app indicates me that they stop receiving any midi data (but maybe this is just because they don't take in account any number above 127).
I really have no idea where is this coming from, when using the wiimote and nunchuck, I never had a such problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group