Lo-Fi_Massahkah Posted April 1, 2005 Report Share Posted April 1, 2005 Hi,I'm trying to build a MidiboxSid controller in my Clavia G2 - so far so good. But I'm having problems understanding the following from the CC-implementation:LFO1 Mode                 Bit 0: Enable LFO             Bit 1: Sync with assigned note events   Bit 2: Sync with all note events      Bit 6-4: Waveform                   0: Sine                    1: Triangle                  2: Saw                    3: Pulse                   4: Random                   5: reserved                  6: reserved                  7: reserved           Example: 11h = 17 = Enable & Triangle Wave           15h = 21 = Enable & Triangle & Sync I don't understand the "bit 6-4" concept, and I can't seem to figure it out backwards since only Tri waves are mentioned in the example.It should be stated that I really haven't done much Hex/Bin calculations... ever! :-\Any help would be appreciated!Cheers,Mikael Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 1, 2005 Report Share Posted April 1, 2005 Edit: ***PLEASE IGNORE THIS POST***See below!And get sleep or you make silly mistakes which can fry your stuff sometimes!!!!!!!One other way you could read it is this:LFO1 Mode                 Bit 0: Enable LFO             Bit 1: Sync with assigned note events   Bit 2: Sync with all note events      Bit 3: Sine              Bit 4: Triangle            Bit 5: Saw              Bit 6: Pulse             Bit 7: Random   15h = 10101000 = 21 = Enable & Sync & Triangle11h = 10001000 = 17 = Enable & Triangleother eg:C2h = 11000010 = 194 = Enable & Sync Assigned & Pulse1h  = 00000001 = 1 = Disable & RandomI was thinking the other day that it would be really nice if there was an app that had three text boxes, one for binary, one for hex and one for decimal... And if you type a number into any box, it converts the other two boxes as you type... I thought a +/- box would be good too... And bit shifting (left/right)...And an option with the binary to type from right to left like you read it....Of course, it's very simple to program, I just dont have visual C on this machine... Isn't there an open-source c++ IDE/Compiler on sourceforge?Anyway there's this: http://www.aquariussoft.com/downloads/pc-binary-conversion-downloaded.asp .... it's nagware though, $14 to buy There's this freebie, very nice and simple, but no shifting, and rather limited: (also note the LCD character generator there, look familiar? :) ) www.everydaylogic.comThere's some code here:http://www.marston-home.demon.co.uk/Tony/uniface/tip32.htmlAnd some theory here:http://www.janeg.ca/scjp/oper/binhex.htmlGoogle is your friend, this is everywhere...Hope this helps Quote Link to comment Share on other sites More sharing options...
sjakie Posted April 1, 2005 Report Share Posted April 1, 2005 bit 6-4 means bit 4,5 and 6 together can form a number 0-7 selecting one of the options listed. It is written backward (6-4) because the high value of those three bits need to go into bit 6.So;Bit 654000 Sine (== 0+0+0 = 0)001 Triangle (== 0+0+1=1)010 Saw (== 0+2+0 =2)011 Pulse(==0+2+1=3)100 Random (==4+0+0=4)101 Res ...110 Res111 ResOf course the bits have pos 4, 5 and 6 so the actual values when put into this cc value are 16, 32,64. (So pulse is 48)Note that when writing a value bitwise you should (as with all numbers) start with the highest value bit. (Bit 7 in this case)So 1000 0010 = (128 + 2) = 130. bit 7654 3210You can do also sorts of conversions with windows calculator, just put it into scientific mode. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 1, 2005 Report Share Posted April 1, 2005 Man I need waaayyyyy more sleep, I can't think straight! This is what happens when you are working 70+ hours a week! ;D Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 1, 2005 Report Share Posted April 1, 2005 That is so funny, I went to adjust the post and I even said in there: And an option with the binary to type from right to left like you read it....Notice C2 was correct, but 1 was not?LOL! :D I converted it from 5 bit to 8 bit by tacking the 000 on the *end* for some strange reason hahahahaaaa*slaps himself*I didn't even notice it said 6-4, i just assumed it was 3-7 for some fricken weird reason.Regarding windows calculator, you can do that, but you have to make too many clicks to get a quick answer. There's calculator.org too for that kinda thing.Anyway, just to clear it up, here it is, correctly this time! (with examples to clear it up for those new to binary, which you'd think I was today!)XXXXX001 = EnableXXXXX010 = Sync assignedXXXXX100 = Sync allX000XXXX = SineX001XXXX = TriangleX010XXXX = SawX011XXXX = PulseX100XXXX = Random00010001 = Enable & Triangle00010101 = Enable & Sync & Triangle00010011 = Enable & Sync Assigned & Triangle00110001 = Enable & Pulse01000011 = Enable & Sync Assigned & RandomNote bit 3 & 7 (read from the right)never get usedJust to show how tired I am, in this tiny post, I have made over 32 typing errors!!! 6 in this sentence alone! I'm really sorry if I've caused any confusion. If I get it wrong this time, someone pelase shoot me so I get some sleep for a change! Quote Link to comment Share on other sites More sharing options...
Lo-Fi_Massahkah Posted April 2, 2005 Author Report Share Posted April 2, 2005 Thank you very much, StrydOne and Sjakie!Sleep or no sleep these are excellent explanations... :)I'll continue my patch today!Regards,Mikael Quote Link to comment Share on other sites More sharing options...
Lo-Fi_Massahkah Posted April 2, 2005 Author Report Share Posted April 2, 2005 So 1000 0010 = (128 + 2) = 130. bit 7654 3210Hmmm... When reading this again - I get confused. ???How can I send a CC above 127?/Mikael Quote Link to comment Share on other sites More sharing options...
Lo-Fi_Massahkah Posted April 2, 2005 Author Report Share Posted April 2, 2005 Hmmm... When reading this again - I get confused. ???How can I send a CC above 127? Edit:Maybe the need will never occur because of those unused bits.../Mikael Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 2, 2005 Report Share Posted April 2, 2005 Exactly. Because the highest bit is never used, there are only 7 bits used.in binary, the most you can you can have is 1111111The way it works is this... If the byte is all 0's, that's 0. Thats nice and easy :)The 1st bit, from the right hand side, is equal to 1 in decimal when it is set, or on, or a '1'. However you like to say itThe 2nd bit, from the right hand side, is equal to 2 in decimalThe 3nd bit, from the right hand side, is equal to 4 in decimalThe 4th bit, from the right hand side, is equal to 8 in decimalThe 5th bit, from the right hand side, is equal to 16 in decimalThe 6th bit, from the right hand side, is equal to 32 in decimalThe 7th bit, from the right hand side, is equal to 64 in decimalThe 8th bit, from the right hand side, is equal to 128 in decimalSo you see, the decimal value doubles each higher bitYou then add up the value of any bits that are 'set' - the one's.So00000001 is 100000010 is 200000100 is 4...10000000 is 128but in this case we don't use bit 7 - and00000101 is like 4 AND 1 (see just above), so that's 500000111 is like 4 AND 2 AND 1, so that's 700010001 is like 1 AND 16, so that's 1710000000 is 12810000001 is 12910000010 is 130Maybe this helps...So anyway, because this is a computer not a human, the counting starts with 0, not with 1.As you know, we don't use bits 7 or 3. This is counting from 0. So we never use the 8th bit from the right - bit7, or the 4th from the right, bit 3. The far right bit, the "1st" bit, is called bit 0, because we're counting from zero, not one.so this means that the highest you can go with 7 bits is like this:01111111If you grab the calculator of your choice, and convert from binary to decimal, you will find that this is 127 decimal. This allows 128 different settings, including zero.I hope this helps, and doesn't confuse matters further. I have had alcohol to drink for the first time in years tonight, so this may be completely incomprehensible!More sake and moet please!! ;D ;D Quote Link to comment Share on other sites More sharing options...
Lo-Fi_Massahkah Posted April 2, 2005 Author Report Share Posted April 2, 2005 Thanks, my friend!That alcohol seems to have no affect on you what so ever... ;)Cheers,Mikael Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.