#### Re: Questions on using CV 51.15 System Pitch Shift

kjlovesya

Bruce,

Dave's answer is correct.   I would like to add a little clarification to the bit 7 issue.

Please bear with me.  I'll try to write this for everyone to understand - even those who have no idea how a computer operates (your decoder is a miniature computer).

Bits and Bytes:   A bit is a simple switch (On or Off).  On is equal to logic 1 and Off is equal to logic 0.

e.g.   Bit 0 = 0 means the bit is turned Off.   Bit 0 = 1 means the bit is turned On.

If one arranges 8 Bits together that equals one Byte.    Engineers always start counting from number 0 so the first bit is labelled Bit 0.

In a Byte we write Bit 0 at the extreme right and call it the least significant bit.

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (0 - 7 remember we start counting at 0)

The value of each bit is either logic 1 or logic 0.   Binary means counting by twos.   Each bit's weight is twice the weight of the bit to it's right.
The weight of Bit 0 is 1.  The weight of Bit 1 is double the weight of the preceding bit, therefore the weight of Bit 1 is 2.   The weight of Bit 2 is double that of the preceding Bit.  The weight of Bit 2 is 4. etc.

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
weight     128     64        32       16        8         4          2          1

Add up all the weights and you get 255.   The value of the Byte is the sum of the Bit weights.   That's why many of the C.V. values are between 0 - 255.      Many C.V.s are  basically the value of one Byte.

If a value of the CV 3 = 0  then all the bits will be written as logic 0.

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value          0        0         0         0         0         0          0         0

If the value of the C.V. 3 = 2   then Bit 1 will be written as a logic 1

weight     128     64        32       16        8         4          2          1

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value          0        0         0         0         0         0          1         0

If the value of CV 3 = 17  then Bit 0 is logic 1 and Bit 4 is logic 1.

weight     128     64        32       16        8         4          2          1

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value          0        0         0         1         0         0          0         1

Add the weights of the bits with a value of logic 1 to determine the value of the Byte.

Negative numbers:
If required, some C.V.s need a positive or a negative value.  Picture a balance control on a stereo where the center is 0.   Left speaker is less than 0 (negative) and Right speaker is greater than 0.
In order for engineers to get negative numbers they simply use the most significant (left most) Bit as a negative sign.   In our example if Bit 7 is 0, the sum of the bits the the right are positive.     If Bit 7 is 1, the sum of the bits to the right are negative.

A value of zero is zero so the sign (negative or positive) doesn't matter.  Therefore 0 is the same as 128.

However, numbers between 128 up to and including 255 have logic 1 for Bit 7.   Therefore each number above 128 is a negative value.

Since Bit 7 is logic 1,  In order to determine the negative value of this type of C.V. we simply add the weight of the less significant bits (bits 0 - 6).

weight     128     64        32       16        8         4          2          1

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value         1       0         0         0         0         0          0         0           = indicates negative number in this case

If we write the weight of 129 to our CV:

weight     128     64        32       16        8         4          2          1

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value          1       0         0         0         0         0          0         1

Then our CV has a value of - 1.

If our CV has a weight of 138

weight     128     64        32       16        8         4          2          1

e.g.         Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1    Bit 0      = 8 Bits (remember we start counting at 0)
value          1       0         0         0         1         0          1        0

Our CV now has a value of - 10. (the sum of Bits 0 - 6)

I hope this helps.

Best regards,
KJ

Join QSIndustries@groups.io to automatically receive all group messages.