Professional Documents
Culture Documents
#############
# The following is 'czmidiguide' from the midi-archive.
#############
-------------------------------------------------------------------------------
----------------- CASIO CZ MIDI GUIDE condensed version ----------------------
-------------------------------------------------------------------------------
---- or: Everything you Never Wanted to Know about MIDI but are going to ------
------------------- Find Out Anyway -------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Right, at long last, I have been able to get a reply out of CASIO UK about the
MIDI standards of the CZ series of synthesizers. For those of you who know
how to play your keyboard by remote control from a computer, this will be of
some interest, since it covers transmission of programming information ( both
to and from the CZ ), setting of the controllers you previously couldn't access
like tone mix level, and other bits besides.
First off, let's recap on the simple stuff. The MIDI is a digital interface to
musical instruments, and relies on serial transmission of data. These data are
usually talked of in terms of bytes, and I shall be using hexadecimal numbers
in this posting.
There are basically two types of bytes sent over MIDI - control bytes and data
bytes. Control bytes are distinguished by having values over 0x80 ( 80 hex,
128 decimal ), and these have valious meanings:
1) NOTE ON
----------
A note on message consists of sending a "NOTE ON" control byte, the note number
you want to turn on, and the velocity at which you want to play the note. The
note on control is 90 plus the channel number. So, for example, if you want to
play note 32 ( = hex 20) at speed 64 (= hex 40), on the midi instrument receiv-
ing on channel two, then you would send:
92 20 40
NOTE ON, channel 2 Note #32 Velocity 64
If you wish to turn two or more notes on at the same time, the control byte
need not be retransmitted. Eg to turn note 35 on as well, you could send
92 20 40 23 40
NOTE ON, ch2 ---32 on-- ---35 on--
These codes can be transmitted both ways on all the CZ 101,1000,5000, but since
they do not detect note velocity, it is always transmitted and recognized as
64 (= 40 hex).
2) NOTE OFF
-----------
Just send a note on message with velocity 0. Eg to turn note 35 off, send
92 23 00
NOTE ON,Ch 2 --35 off--
3) CONTROL CHANGE
-----------------
There are several controls that can be set from MIDI. Just send a "CONTROL CH"
byte , which is B0 plus the channel number, the number of the control that you
wish to change, then the value you wish to set it to. Eg for CZ101 portamento
time, send
B0 05 10
CONTROL, ch 0 --ctrl 5=16--
CZ101/1000
CZ5000
4) PROGRAM CHANGE
-----------------
This allows you to change between the preset sounds ( and your internal
sounds and cartridges ). Just send C0 plus the channel number, then the
program number. Eg to set CZ101 on channel 1 to Synth Bass:
C1 07
PROGRAM ch 1 Program 7
CZ101/1000
CZ5000
This is acheived by sending E0 plus the channel number, then two bytes
denoting the new value of pitch bend. The first byte is the most significant,
and the second the least significant. Note also that the lower 6 bits of the
lower byte are not used, and that the central position of the wheel corres-
ponds to the byte sequence 40 00.
HIGHEST 7F 40
HIGHER
CENTER 40 00
LOWER
LOWEST 00 00
So, to bend the instrument on channel two UP by about half its maximum amount,
send
E2 60 00
BEND channel two ---1/2 up--
6) AFTER TOUCH
--------------
Is not supported on the CZ101/1000/5000. Sorry!
7) MODE CHANGE
--------------
This is very similar to the CONTROL CHANGE message, and can be regarded as a
special case.
Local mode means that the keyboard is "connected" to the sound producing
part of the CZ within the machine itself. With LOCAL ON ( the default setting ),
playing the keyboard both sends note messages out of the MIDI port, and also
makes sounds at the same time. If you want to do wierd things like keyboard
splitting, LOCAL OFF will allow you to see what the keyboard is doing without
the CZ making any sound at all. You could then act on that information and send
the keyboard a command depending on the keys that has nothing to do with them,
eg program change or pitch bend. The possibilities are endless !
SEQUENCER MESSAGES
------------------
The CZ5000 has its own internal sequencer, which can be controlled by:
Ok, so not very specific, bu that was deliberate to allow manufacturers to use
all the lovely bells and whistles they put on their machine over the MIDI !
Since these are usually controlled by computer, I have set them out as a
computer/synthesizer dialogue. Note that the computer MUST wait for replies
before proceding, or all will fail !
2) KEY TRANSPOSE
----------------
Data is as follows:
Key: G A A# B B# C C# D E E# F F#
Data: 45 44 43 41 41 00 01 02 03 04 05 06
3) TONE MIX
-----------
The data is 00 to turn tone mix off, or 41..49 for mix level 1..9
Computer: F0 44 00 00 70+channel 19 00
CZ101/1000: F0 44 00 00 70+channel 30
Computer: 70+channel 31
CZ101/1000: data1 data2 F7
Computer: F7
data2 00 10 20 30
Vibrato OFF OFF ON ON
Port'o OFF ON OFF ON
Eg an exchange such as
Computer: F0 44 00 00 70 19 00 "Want data on channel 0"
CZ101: F0 44 00 00 70 30 "Gotcha.. data ready"
Computer: 70 31 "Ok, give it to me"
CZ101: 27 30 F7 "Internal 8, v on, p on"
Computer: F7
REMOTE PROGRAMMING
------------------
The send request 1 and receive request 1 messages.
These dump a lot of data across the MIDI, which is the same for both messages,
except that the data go the other way. The exchanges are:
Send request
Computer: F0 44 00 00 70+channel 10 program
CZ101/1000: F0 44 00 00 70+channel 30
Computer: 70+channel 31
CZ101/1000: <tone data> F7
Computer: F7
Receive request
Computer: F0 44 00 00 70+channel 20 program
CZ101/1000: F0 44 00 00 70+channel 30
Computer: <tone data> F7
Cz101/1000: F7
The program byte is the same as that set by the PROGRAM CHANGE function, with
the addition that you can request the temporary sound area as well ( number is
60 ). This is the area that is used if you have altered a preset and not saved
it into internal memory.
<tone data> is a sequence of 256 bytes containing a LOT of info. Now Casio have
done a lot of funny things with these, like splitting bytes in half and encoding
things in wierd ways so please bear with me.
To keep everything this side of infinite length, I shall adopt the same strategy
as the manual, which is to write data in bytes, although they are transmitted
in half- bytes. For example, me writing a byte as 5F requires you to transmit or
receive as 0F 05 ( wierd, huh ? ). This will obvoiusly save a lot of space.
1) PFLAG
Looking at bits,
0000 00 00
Not used^ OCTV LS
OCTV controls octave range: 00=octave 0, 01=+1, 10=-1
2)PDS
For detune +, PDS is 0, for detune - it is 01
3)PDETL,PDETH
OCT: 0 1 2 3
NOTE: 0..11 0..11 0..11 0..11
Byte: 00..0B 0C..17 18..23 24..2F
4) PVK
WAVE NUMBER: 1 2 3 4
Byte: 08 04 20 02
5) PVDLD,PVDLV
For delays in the range 0..31, just transmit 00..1F, 00, 00..1F eg for delay
of 12, send 0C 00 0C. This is convenient since it saves me typing in another
column of boring numbers ;-)
6) PVSD,PVSV
Again, here comes another table for conversions. The first column (0..24) is
omitted since the only difficult thing needed is to add 01 00 20 to each entry
( The first few go 00 00 20, 01 00 40, 02 00 60, ... 06 00 E0, 07 01 00, ..)
7) PVDD,PVDV
These are again encoded as three bytes in a most obscure way. Below 32, the
encoding is 00..1F, 00, 01..20 eg for depth 13, send 0D 00 0E.
8) MFW
These two bytes transmit the waveform for DCO1, and also the modulation ie
ring, noise or none.
First=1 000 0 00
Fisrt=2 001 0 00
First=3 010 0 00
First=4 100 0 00
First=5 101 0 00
First=6 110 0 01
First=7 110 0 10
First=8 110 0 11
Second=1 000 1 0 00
Second=2 001 1 0 00
Second=3 010 1 0 00
Second=4 100 1 0 00
Second=5 101 1 0 00
Second=6 110 1 0 01
Second=7 110 1 0 10
Second=8 110 1 0 11
NO MODULATION 000
RING MODULATION 100
NOISE MODULATION 011
9) MAMD,MAMV
Key follow: 0 1 2 3 4 5 6 7 8 9
1st byte: 00 01 02 03 04 05 06 07 08 09
2nd byte: 00 08 11 1A 24 2F 3A 45 52 5F
Key follow: 0 1 2 3 4 5 6 7 8 9
1st byte: 00 01 02 03 04 05 06 07 08 09
2nd byte: 00 1F 2C 39 46 53 60 6E 92 FF
11) PMAL
This sets the position of the end step on DCA1. Step 1..8 gives bytes 00..07.
12) PMA
Given that you wish to set rate r, the data you need to send is
Byte= 119 x r
-------
99
Conversely, if byte=0, rate=0, if byte=7F, rate=99, otherwise
r=99 x byte
--------- + 1
119
13) PMWL
14) PMW
15) PMPL
Another end step setting, this time for DCO1. Same as PMAL and PMWL
16) PMP
Another envelope setting, this time for the DCO1 rates and levels. Again uses a
completely different encoding scheme.
For the level, level data 0..63 translate as bytes 00..3F, and level data
64..99 translate as bytes 44..67.
17) SFW
These two bytes set the waveform for DCO2. They use the same format as MFW
does for DCO1, except that the modulation bits are ignored ( it is best to set
these bits to zero , just in case ).
18) SAMD,SAMV
19) SWMD,SWMV
20) PSAL
21) PSA
22) PSWL
23) PSW
24) PSPL
25) PSP
All the above use the same formats as their counterparts for the first set of
DCO,DCW,DCA, and perform exactly the same functions on the DCA2,DCW2,and DCO2.
This concludes what I hope has been an informative article ( if rather a long
one :-) ).
Thong
[ The views above are my own (except any quotes !) and not anyone elses.. so ]
[ flame me personally, not them ]
+------------------------------------------------------------------------------+
| |
| "Thong" Ellis, Reading University Computer Science VAX "Sage", England |
| |
| "But there aren't any REAL people here at all..." : Roosta |
| |
+------------------------------------------------------------------------------+