Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Easy Answer: Open up Calculator and make sure its on Scientific mode. Make sure Hex is clicked (just under the display). Punch in 99, click on binary and you get 10011001.

 

Complex Answer: Google it. Its an annoying MOD math...

basically Hex is a base16 number system. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

 

Decimal (the common number system) is base10 (deci, get it?). Binary is base2 (bi). Binary only has 0 and 1. 8 digits in a byte.

 

theres a conversion forumla. Its been a year since I've used it, so I wouldn't trust my memory. Google for Base16 to Base2 conversions and you should find it. Maybe someone here is into Assembler and knows it well.

Posted

thanks, but i meant how do i convert it within .net. sorry i wasn't completely clear.

 

maybe this will help make more sense.

 

i'm porting over a visualbasic.net midi class to c#.

 

Here is how the method in vb:

Public Sub SendMsg(ByVal Status As Byte, Data1 As Byte, Data2 As Byte)

...

 

and here is how it is called:

Midi.SendMsg(&H99, 38, 127)

 

I'm trying to figure out how to call it the same way in c#. in peticular the &H99 part.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...