|
||
Title: How to reencode to 32bit Post by Image_Engine on Jul 7th, 2008, 4:40pm Hi I want to compare the raw midi with some values I have and do the comparison based on the 32bit number for speed sake. How do I compose my stat, dat1 and dat2 back into 32bit? Cheers Mark |
||
Title: Re: How to reencode to 32bit Post by Jamie OConnell on Jul 22nd, 2008, 2:33am Windows encodes the 32 bits sort of backwards, but it makes it easier to pull them apart. the Status Byte is first followed by Data1 and then Data2. All end up in the low 24 bits of the message. Here's a pseudo code formula you can use : DWORD dwVal = Status + (256 * Dat1) + (65536 * Dat2) 65536 = 256 * 256, effectively shifting the bytes into place. in C and C++ you can use: DWORD dwVal = Status + (Dat1 << 8) + (Dat2 << 16) |
||
Title: Re: How to reencode to 32bit Post by Image_Engine on Jul 22nd, 2008, 4:34am Thanks Jamie Im only coding in VBScript to control ableton live (after running out of steam in Midi Translator) so I was just going to use 'case select' for efficient comparison (a lot easier to read too!) but also branch to a loop from the sink but it worked out a lot better just using an activex timer. I also wanted to make a html 'feedback panel' that gave visual feedback on current patch selected etc and set it just above Live window. That info helps a lot. Also, I sent a PM a little while back because I thought the forum had died ie no action on it for quite a while. Cheers Mark |
||
MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1! YaBB © 2000-2003. All Rights Reserved. |