Results 1 to 1 of 1
- 03-06-2012, 06:17 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 1
- Rep Power
- 0
Midi message from an input device. Help needed with the messages I'm receiving.
I am using the CDJ-101 midi controller as an input device for a piece of software I am writing for a university project. I have it recognizing different button presses, but I cannot distinguish between clockwise and anti clockwise rotation on the jog wheel. The midi note for the wheel turning is always returned as 53 regardless of direction. The same goes for the "push" rotating button next to the jog wheel.
Does anyone have any clue as to how to distinguish the direction the jog wheel is being rotated?
any help is greatly appreciated. Thank you. Lee.
The code I am using to convert the bytes..
note1 is always 53 when the jog wheel is being rotated in either direction.Java Code:public void send(MidiMessage msg, long timeStamp) { byte[] b = msg.getMessage (); String tmp = bits ( b [0] ) ; int message = convertBits ( tmp ) ; int note1 = convertBits ( bits ( b [ 1 ] ) ) ; } public String bits(byte b){ String bits = ""; for(int bit=7;bit>=0;--bit){ bits = bits + ((b >>> bit) & 1); } return bits; } public int convertBits(String bits){ int res = 0 ; int size = bits.length () ; for ( int i = size-1 ; i >= 0 ; i -- ){ if ( bits.charAt( i ) == '1' ) { res += 1 <<(size-i-1) ; } } return res ; }
Similar Threads
-
Why am I not receiving the message? [Sockets]
By Pathogenic in forum New To JavaReplies: 1Last Post: 04-25-2011, 05:15 AM -
Bluetooth Device Discovery using Netbeans IDE + Java ME Device Manager
By sawyerized in forum CLDC and MIDPReplies: 0Last Post: 02-25-2011, 11:46 AM -
Socket and how to launch thread for receiving socket messages
By newbiejava in forum New To JavaReplies: 1Last Post: 07-02-2010, 01:18 PM -
Receiving Message in J2ME
By java girl in forum CLDC and MIDPReplies: 2Last Post: 10-27-2009, 05:49 AM -
Getting input from MIDI devices on a Mac
By Ben Wheatley in forum Advanced JavaReplies: 1Last Post: 08-05-2009, 06:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks