Yahoo Groups archive

Casio CZ/ VZ/ FZ - Pro Series

Index last updated: 2026-04-28 22:42 UTC

Message

Re: more about sys description

2009-08-11 by steve_the_composer

Are you working in hex? Are you good with binary and masking? If so, think binary. Evidently with the CZ you have nybbilized 8 bit words--the 8 bits are divided into 2 4-bit nybbles. 

With the full 8-bit word, the Most Significant Bit (bit 8) tells whether the midi byte is a command or data. For example (all hex or binary):

90 34 7F
(on the first midi channel, turn note 34 on with maximum velocity)
90 = 1001 0000 
34 = 0010 0100
7F = 0111 1111

Sysex commands start with F0 and end with F7. Its been a while since I did programming with CZ midi data, but evidently each half is sent out separately. You'd have to check which comes first, LSB or MSB. I think it may be LSB. If I am right, F0 would be sent out as 0000 1111. (Double check this.)

I did my CZ midi programming on a Commodore C-64 with an 6502/6510 processor using assembly language. This let me mask the most significant 4 bytes and the least significant bytes and shift them to get them into position. I think this is how I did it (using a value of 7F as an example) to create the nybblized data to send :

data: 0111 1111
mask: 0000 1111 (and)
=====================
gave: 0000 1111 [0F]

data: 0111 1111
mask: 1111 0000 (and)
=====================
gave: 0111 0000
shifted right 4 times gave: 0000 0111 [07]

Thus, nybblized 7F in lsb msb order is 0000 1111 0000 0111 [0F 07]. 
(See below for decimal explanation of why 127 becomes 15 7.) 

When receiving nybblized data, I must have used something like this (again assuming lsb comes first):

data1: 0000 1111

data2: 0000 0111
shifted left 4 times: 0111 0000  

data1: 0000 1111
data2: 0111 0000 [after shift, then ored]
===================
gives: 0111 1111
(See below for how in decimal 7 15 becomes 127.)

Since each shift left = x 2, 4 lefts shifts = 2^4 or 16.

=======================================================

Let me see if I can do this in decimal.

nybblizing process [converting 127 to send]:
127 / 16 = 7 with a remainder of 15.
Remember 7 is the msb; 15 is the lsb, so 127 becomes (in lsb msb order) 15 7.

reverse nybblizing process [receiving and restoring data recived]:
take the 15, add it to 7 * 16.

I think this should explain (1) why to send you need to split and divide by 16 (2^4) using both the result and the remainder and (2) why when receiving you need to multiply the second number by 16 and then add it to the first number.

Hope this makes sense and hope it helps.

--Steve

(Again, its been a while, so double check to see if its nybblized lsb msb order. Based on what you posted a few messages ago (when I said you are splitting and reversing), I think I have reconstructed the process correctly. I will look to see if I have any code.)


--- In CZsynth@yahoogroups.com, "charlie from PARRY" <charles.copp@...> wrote:
>
> hold on is it as simple as taking a 16 bit nuber and using the msb and lsb
> of it ? basically dividing it by 256?
> 
> or would i do a byte  split  into two separte bytes?
> 
> a integer divide by  16
>   and
> a  X and 15 ???
> 
> still tho , anybody have written their own editor for the cz101 at all?
> 
> curious
> charles
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.