Cookies
We and our partners store and/or access information on a device, such as cookies and process personal data, such as unique identifiers and standard information sent by a device for personalised ads and content, ad and content measurement, and audience insights, as well as to develop and improve products.
More options
AGREE →
Discussion:
14 bit CCResponder / adding bytes
(too old to reply)
Tomer Harari
2008-07-06 09:21:21 UTC
Permalink
Hi,

I am trying to use 14 bit CC option from my Behringer BCR controller.
After setting up the device to send 14 bit cc, I am using a CCResponder to
grab the incoming midi infromation.
14 bit Control change message is actually two 7 bit midi messages,
One on CC numbers 0 - 31 (MSB), and another on CC numbers 32 - 63 (LSB)
respectively.
So when sending 14 bit CC on channel 2 i get :
[ 618189095, 1, 1, 0 ] // 0 is the MSB
[ 618189095, 1, 33, 81 ] // 81 is the LSB

My question is how do i add these two data bytes together so they form one
number in the range of 0 - 16,385 and not two numbers in the range of 0 -
127?

Thanks,
Tomer
--
View this message in context: http://www.nabble.com/14-bit-CCResponder---adding-bytes-tp18300199p18300199.html
Sent from the Supercollider - User mailing list archive at Nabble.com.



_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Sciss
2008-07-07 17:50:11 UTC
Permalink
shift the MSB to left by 8 bit (or multiply it by 256), e.g. (msb <<
8) + lsb
Post by Tomer Harari
Hi,
I am trying to use 14 bit CC option from my Behringer BCR controller.
After setting up the device to send 14 bit cc, I am using a
CCResponder to
grab the incoming midi infromation.
14 bit Control change message is actually two 7 bit midi messages,
One on CC numbers 0 - 31 (MSB), and another on CC numbers 32 - 63 (LSB)
respectively.
[ 618189095, 1, 1, 0 ] // 0 is the MSB
[ 618189095, 1, 33, 81 ] // 81 is the LSB
My question is how do i add these two data bytes together so they form one
number in the range of 0 - 16,385 and not two numbers in the range of 0 -
127?
Thanks,
Tomer
--
View this message in context: http://www.nabble.com/14-bit-
CCResponder---adding-bytes-tp18300199p18300199.html
Sent from the Supercollider - User mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/
MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Sciss
2008-07-07 17:52:56 UTC
Permalink
or wait it's 7 bit not 8 bit, so should be (msb << 7) + lsb
Post by Sciss
shift the MSB to left by 8 bit (or multiply it by 256), e.g. (msb
<< 8) + lsb
Post by Tomer Harari
Hi,
I am trying to use 14 bit CC option from my Behringer BCR controller.
After setting up the device to send 14 bit cc, I am using a
CCResponder to
grab the incoming midi infromation.
14 bit Control change message is actually two 7 bit midi messages,
One on CC numbers 0 - 31 (MSB), and another on CC numbers 32 - 63 (LSB)
respectively.
[ 618189095, 1, 1, 0 ] // 0 is the MSB
[ 618189095, 1, 33, 81 ] // 81 is the LSB
My question is how do i add these two data bytes together so they form one
number in the range of 0 - 16,385 and not two numbers in the range of 0 -
127?
Thanks,
Tomer
--
View this message in context: http://www.nabble.com/14-bit-
CCResponder---adding-bytes-tp18300199p18300199.html
Sent from the Supercollider - User mailing list archive at
Nabble.com.
_______________________________________________
sc-users mailing list
8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list
info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/
MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2008-07-07 18:15:31 UTC
Permalink
Well, the real problem is that the MSB and LSB come in at separate
times, and you can't control which one comes in first.

So what you need is an object that receives MSB and LSB separately,
and fires the action only after both arrive.

Something like this prototype would do it:

x = (
action: { |value| value.debug("got both bytes") },
testFire: { |z|
if(z.lsb.notNil and: { z.msb.notNil }) {
z[\action].value(z.msb << 7 + z.lsb);
z.put(\msb, nil).put(\lsb, nil);
}
},
msb_: { |z, byte|
z.put(\msb, byte);
z.testFire;
z
},
lsb_: { |z, byte|
z.put(\lsb, byte);
z.testFire;
z
}
);

Then set your CCResponder objects so that the one for cc1 does the
action "x.msb = byte" and cc31 does "x.lsb = byte" -- the action
function saved in the prototype will run only after both messages come
in.

hjh
--
James Harkins /// dewdrop world
jamshark70-***@public.gmane.org
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...