Yahoo Groups archive

Casio CZ/ VZ/ FZ - Pro Series

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

Thread

more about sys description

more about sys description

2009-08-10 by charlie from PARRY

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

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:
Show quoted textHide quoted text
>
> 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
>

Re: [CZsynth] Re: more about sys description

2009-08-11 by Lee Borrell

I am familar with Hex and binary - I teach IT and have an A level in computing.
I use the MIDI system quite closely - so know it quite well.
 
I think Charles is on the right line about seperating the Nybbles - using divide by 16 and anding with 15. As to which nybble is which I cannot recall - you maybe right about them being reversed. It also seems that you are of the same variety of programming as myself - I used 6502 assembly to write routines for the Vic20 and PSS series yamaha.
 
http://templarseries.atspace.com/maplin.html

--- On Tue, 11/8/09, steve_the_composer <smw-mail@prodigy.net> wrote:
Show quoted textHide quoted text
From: steve_the_composer <smw-mail@...>
Subject: [CZsynth] Re: more about sys description
To: CZsynth@yahoogroups.com
Date: Tuesday, 11 August, 2009, 5:25 PM


  



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
>

















      

[Non-text portions of this message have been removed]

Re: more about sys description

2009-08-12 by steve_the_composer

Cool page--a blast from the past!!!!!! If I remember correctly I worked with a Passport and a Sequential MIDI interfaces with the C-64. I also picked up a SONUS, but I think that conformed to the design of one of the other two. The reading and writing of interface registers was all self-taught. I think the 6502 manual (or was it an 8502 manual?) also had the specs for chips used in the midi interface.

I still remember the day I pressed the broom handle across my CZ-5000 keyboard and jumped for joy that my routine successfully captured all of the simultaneous note on/note off bytes.

I am sure my C-64 routines worked. Double check the asm codes I uploaded to the file section, but on reconstructing it, it looks like the lowest significant nybblized byte was transmitted before the highest.   

Gee whiz, I can remember looking up 6502 instruction timing cycles in order to make it as tight as possible. 

BTW, evidently GFA Basic allows for inline assembly language (at least according to the ones I read about). 

--Steve 
 

--- In CZsynth@yahoogroups.com, Lee Borrell <templarser@...> wrote:
Show quoted textHide quoted text
>
> I am familar with Hex and binary - I teach IT and have an A level in computing.
> I use the MIDI system quite closely - so know it quite well.
>  
> I think Charles is on the right line about seperating the Nybbles - using divide by 16 and anding with 15. As to which nybble is which I cannot recall - you maybe right about them being reversed. It also seems that you are of the same variety of programming as myself - I used 6502 assembly to write routines for the Vic20 and PSS series yamaha.
>  
> http://templarseries.atspace.com/maplin.html
> 
> --- On Tue, 11/8/09, steve_the_composer <smw-mail@...> wrote:
> 
> 
> From: steve_the_composer <smw-mail@...>
> Subject: [CZsynth] Re: more about sys description
> To: CZsynth@yahoogroups.com
> Date: Tuesday, 11 August, 2009, 5:25 PM
> 
> 
>   
> 
> 
> 
> 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
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>       
> 
> [Non-text portions of this message have been removed]
>

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.